diff --git a/ui/artalk/src/layer/layer.ts b/ui/artalk/src/layer/layer.ts index 9ccf26d0..f60319c5 100644 --- a/ui/artalk/src/layer/layer.ts +++ b/ui/artalk/src/layer/layer.ts @@ -1,9 +1,11 @@ +import type { Layer as LayerApi } from '@/types/layer' + export interface LayerOptions { onShow: () => void onHide: () => void } -export class Layer { +export class Layer implements LayerApi { private allowMaskClose = true private onAfterHide?: () => void @@ -33,13 +35,13 @@ export class Layer { this.$el.style.display = '' } - async hide() { + hide() { this.opts.onHide() this.$el.style.display = 'none' this.onAfterHide && this.onAfterHide() } - async destroy() { + destroy() { this.opts.onHide() this.$el.remove() this.onAfterHide && this.onAfterHide() diff --git a/ui/artalk/src/types/index.ts b/ui/artalk/src/types/index.ts index 69416870..e38be02b 100644 --- a/ui/artalk/src/types/index.ts +++ b/ui/artalk/src/types/index.ts @@ -5,4 +5,5 @@ export type * from './editor' export type * from './event' export type * from './plugin' export type * from './sidebar' +export type * from './layer' export type { I18n, I18nKeys } from '../i18n' diff --git a/ui/artalk/src/types/layer.ts b/ui/artalk/src/types/layer.ts new file mode 100644 index 00000000..4310819c --- /dev/null +++ b/ui/artalk/src/types/layer.ts @@ -0,0 +1,9 @@ +export interface Layer { + show: () => void + hide: () => void + destroy: () => void + setOnAfterHide(func: () => void): void + setAllowMaskClose(allow: boolean): void + getAllowMaskClose(): boolean + getEl: () => HTMLElement +} diff --git a/ui/plugin-kit/src/plugin/dts.ts b/ui/plugin-kit/src/plugin/dts.ts index 2bd910df..e2f17ba1 100644 --- a/ui/plugin-kit/src/plugin/dts.ts +++ b/ui/plugin-kit/src/plugin/dts.ts @@ -19,7 +19,7 @@ export function generateDts( const diagnostics = [ ...program.getDeclarationDiagnostics(), ...program.getSemanticDiagnostics(), - ...program.getSyntacticDiagnostics() + ...program.getSyntacticDiagnostics(), ] if (diagnostics?.length) {