Skip to content

Commit

Permalink
chore: adjust build;
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanuo committed Jun 5, 2024
1 parent 9dec75b commit 1b8ee5e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ export default defineBuildConfig({
rollup: {
emitCJS: true,
},
alias: {
'~': './src',
},
})
2 changes: 1 addition & 1 deletion src/dom/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ActionMap, type PanDirection, SelectorEnum } from '../types'
import { type ActionMap, type PanDirection, SelectorEnum } from './types'
import './style.css'

const MarkdownItDiagramDomScript: () => void = function () {
Expand Down
9 changes: 9 additions & 0 deletions src/dom/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type PanDirection = 'up' | 'down' | 'left' | 'right'

export interface ActionMap {
[key: string]: () => void
}

export enum SelectorEnum {
IMG = 'diagram-m',
}
15 changes: 3 additions & 12 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MarkdownItDiagramDomScript } from './dom'
import * as dom from './dom/types'
import { SelectorEnum } from './dom/types'

export interface BaseOptions {
/**
Expand All @@ -23,14 +24,4 @@ export interface MermaidOptions extends BaseOptions {
[key: string]: any
}

export type PanDirection = 'up' | 'down' | 'left' | 'right'

export interface ActionMap {
[key: string]: () => void
}

export enum SelectorEnum {
IMG = 'diagram-m',
}

export { MarkdownItDiagramDomScript }
export { dom, SelectorEnum }

0 comments on commit 1b8ee5e

Please sign in to comment.