Skip to content

Commit

Permalink
fix: type path error
Browse files Browse the repository at this point in the history
  • Loading branch information
Barrior committed Mar 21, 2024
1 parent 2c60c83 commit de6ab39
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/common/mask.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Base from '@src/common/base'
import type { CommonConfig } from '@src/types/common-config'
import type { ICanvasImageSource } from '@src/types/utility-types'
import { isString, loadImage, upperFirst } from '@src/utils'

export type modeMethodNames = 'modeNormal' | 'modeGhost'
Expand Down
2 changes: 1 addition & 1 deletion src/common/shape.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Base from '@src/common/base'
import { doublePi, piBy180, regExp } from '@src/common/constants'
import type { CommonConfig } from '@src/types/common-config'
import type { ValueOf } from '@src/types/utility-types'
import type { ICanvasImageSource, ValueOf } from '@src/types/utility-types'
import { isArray, isString, loadImage } from '@src/utils'

const validShapeTypes = ['circle', 'triangle', 'star', 'image'] as const
Expand Down
5 changes: 0 additions & 5 deletions src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ interface Window {
mozRequestAnimationFrame?: AnimationFrameProvider['requestAnimationFrame']
WebKitMutationObserver?: MutationObserver
}

/**
* 排除没有 width 和 height 属性的元素
*/
type ICanvasImageSource = Exclude<CanvasImageSource, SVGImageElement>
5 changes: 5 additions & 0 deletions src/types/utility-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
* 获取 interface 或(类)数组的值
*/
export type ValueOf<T> = T extends ArrayLike<unknown> ? T[number] : T[keyof T]

/**
* 排除没有 width 和 height 属性的元素
*/
export type ICanvasImageSource = Exclude<CanvasImageSource, SVGImageElement>
1 change: 1 addition & 0 deletions src/types/wave.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CommonConfig } from './common-config'
import type { ICanvasImageSource } from './utility-types'

export interface ComOptions {
// 是否填充背景色,设置为 false 相关值无效
Expand Down

0 comments on commit de6ab39

Please sign in to comment.