formula-editor-vue3
Version:
codemirror formula editor for vue3
165 lines (163 loc) • 5.38 kB
TypeScript
import { Plugin } from 'vue';
type SFCWithInstall<T> = T & Plugin;
export { FORMULA_MATHS } from './utils/math';
export * from './interfaces';
export { evalFormula, isCloseBrackets } from './utils/formula';
export declare const FormulaEditor: SFCWithInstall<{
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
modelValue: import('vue').PropType<any>;
title: {
type: StringConstructor;
default: string;
};
isDark: {
type: BooleanConstructor;
default: boolean;
};
disabled: {
type: BooleanConstructor;
default: boolean;
};
height: {
type: NumberConstructor;
default: number;
};
placeholder: {
type: StringConstructor;
default: string;
};
variables: {
type: import('vue').PropType<import('./interfaces').VariableItem[]>;
default: () => never[];
};
mathList: {
type: import('vue').PropType<import('./interfaces').MathItem[]>;
default: () => import('./interfaces').MathItem[];
};
}>> & Readonly<{}>, {
insertMaths: (mathName: string) => void;
insertVariables: (varName: string) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
title: string;
isDark: boolean;
disabled: boolean;
height: number;
placeholder: string;
variables: import('./interfaces').VariableItem[];
mathList: import('./interfaces').MathItem[];
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('vue').ExtractPropTypes<{
modelValue: import('vue').PropType<any>;
title: {
type: StringConstructor;
default: string;
};
isDark: {
type: BooleanConstructor;
default: boolean;
};
disabled: {
type: BooleanConstructor;
default: boolean;
};
height: {
type: NumberConstructor;
default: number;
};
placeholder: {
type: StringConstructor;
default: string;
};
variables: {
type: import('vue').PropType<import('./interfaces').VariableItem[]>;
default: () => never[];
};
mathList: {
type: import('vue').PropType<import('./interfaces').MathItem[]>;
default: () => import('./interfaces').MathItem[];
};
}>> & Readonly<{}>, {
insertMaths: (mathName: string) => void;
insertVariables: (varName: string) => void;
}, {}, {}, {}, {
title: string;
isDark: boolean;
disabled: boolean;
height: number;
placeholder: string;
variables: import('./interfaces').VariableItem[];
mathList: import('./interfaces').MathItem[];
}>;
__isFragment?: never;
__isTeleport?: never;
__isSuspense?: never;
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
modelValue: import('vue').PropType<any>;
title: {
type: StringConstructor;
default: string;
};
isDark: {
type: BooleanConstructor;
default: boolean;
};
disabled: {
type: BooleanConstructor;
default: boolean;
};
height: {
type: NumberConstructor;
default: number;
};
placeholder: {
type: StringConstructor;
default: string;
};
variables: {
type: import('vue').PropType<import('./interfaces').VariableItem[]>;
default: () => never[];
};
mathList: {
type: import('vue').PropType<import('./interfaces').MathItem[]>;
default: () => import('./interfaces').MathItem[];
};
}>> & Readonly<{}>, {
insertMaths: (mathName: string) => void;
insertVariables: (varName: string) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
title: string;
isDark: boolean;
disabled: boolean;
height: number;
placeholder: string;
variables: import('./interfaces').VariableItem[];
mathList: import('./interfaces').MathItem[];
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
$slots: Readonly<{
math(props: {
insert: (mathName: string) => void;
}): any;
variable(props: {
insert: (varName: string) => void;
}): any;
}> & {
math(props: {
insert: (mathName: string) => void;
}): any;
variable(props: {
insert: (varName: string) => void;
}): any;
};
})>;
export default FormulaEditor;
declare module 'vue' {
interface GlobalComponents {
'formula-editor': typeof FormulaEditor;
}
}