Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(TS): Shadow #8462

Merged
merged 10 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [next]

- chore(TS): migrate Shadow [#8462](https://github.com/fabricjs/fabric.js/pull/8462)
- chore(TS): migrate text classes/mixins [#8408](https://github.com/fabricjs/fabric.js/pull/8408)
- chore(TS): migrate Collection [#8433](https://github.com/fabricjs/fabric.js/pull/8433)
- ci(): Simplify filestats even more [#8449](https://github.com/fabricjs/fabric.js/pull/8449)
Expand Down
2 changes: 0 additions & 2 deletions src/__types__.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ModifierKey, TMat2D } from './typedefs';
/**
* @todo remove transient
*/
export type Shadow = any;
export type Canvas = StaticCanvas & {
altActionKey: ModifierKey;
uniScaleKey: ModifierKey;
Expand All @@ -20,5 +19,4 @@ export type StaticCanvas = Record<string, any> & {
};
getRetinaScaling(): number;
} & Observable;
export type Rect = any;
export type TObject = any;
3 changes: 2 additions & 1 deletion src/brushes/base_brush.class.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { fabric } from '../../HEADER';
import { Color } from '../color';
import { Point } from '../point.class';
import { Canvas, Shadow } from '../__types__';
import type { Shadow } from '../shadow.class';
import { Canvas } from '../__types__';

/**
* @see {@link http://fabricjs.com/freedrawing|Freedrawing demo}
Expand Down
4 changes: 3 additions & 1 deletion src/brushes/circle_brush.class.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { fabric } from '../../HEADER';
import { Color } from '../color';
import { Point } from '../point.class';
import { Shadow } from '../shadow.class';
import { Circle } from '../shapes/circle.class';
import { getRandomInt } from '../util/internals';
import { Canvas } from '../__types__';
import { BaseBrush } from './base_brush.class';

/**
* @todo remove transient
*/
const { Circle, Group, Shadow } = fabric;
const { Group } = fabric;

export type CircleBrushPoint = {
x: number;
Expand Down
7 changes: 2 additions & 5 deletions src/brushes/pencil_brush.class.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { fabric } from '../../HEADER';
import { Point } from '../point.class';
import { Shadow } from '../shadow.class';
import { Path } from '../shapes/path.class';
import { TEvent, ModifierKey, PathData } from '../typedefs';
import { getSmoothPathFromPoints, joinPath } from '../util/path';
import { Canvas } from '../__types__';
import { BaseBrush } from './base_brush.class';

/**
* @todo remove transient
*/
const { Path, Shadow } = fabric;

/**
* @private
* @param {PathData} pathData SVG path commands
Expand Down
6 changes: 4 additions & 2 deletions src/brushes/spray_brush.class.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { fabric } from '../../HEADER';
import { Point } from '../point.class';
import { Shadow } from '../shadow.class';
import { Rect } from '../shapes/rect.class';
import { getRandomInt } from '../util/internals';
import { Canvas, Rect } from '../__types__';
import { Canvas } from '../__types__';
import { BaseBrush } from './base_brush.class';

/**
* @todo remove transient
*/
const { Group, Rect, Shadow } = fabric;
const { Group } = fabric;

export type SprayBrushPoint = {
x: number;
Expand Down
Loading