[improvement] mixins typescript (#3690)
This commit is contained in:
@@ -47,3 +47,5 @@ export function createBEM(name: string) {
|
||||
return mods ? [el, prefix(el, mods)] : el;
|
||||
};
|
||||
}
|
||||
|
||||
export type BEM = ReturnType<typeof createBEM>;
|
||||
|
||||
@@ -10,3 +10,5 @@ export function createI18N(name: string) {
|
||||
return typeof message === 'function' ? message(...args) : message;
|
||||
};
|
||||
}
|
||||
|
||||
export type Translate = ReturnType<typeof createI18N>;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { createBEM } from './bem';
|
||||
import { createBEM, BEM } from './bem';
|
||||
import { createComponent } from './component';
|
||||
import { createI18N } from './i18n';
|
||||
import { createI18N, Translate } from './i18n';
|
||||
|
||||
type CreateNamespaceReturn = [
|
||||
ReturnType<typeof createComponent>,
|
||||
ReturnType<typeof createBEM>,
|
||||
ReturnType<typeof createI18N>
|
||||
BEM,
|
||||
Translate
|
||||
];
|
||||
|
||||
export function createNamespace(name: string): CreateNamespaceReturn {
|
||||
|
||||
Reference in New Issue
Block a user