mirror of
https://github.com/directus/directus.git
synced 2026-02-02 10:25:05 -05:00
16 lines
393 B
TypeScript
16 lines
393 B
TypeScript
import { i18n } from '@/lang';
|
|
import { InterfaceDefineParam, InterfaceContext, InterfaceConfig } from './types';
|
|
|
|
export function defineInterface(config: InterfaceDefineParam): InterfaceConfig {
|
|
let options: InterfaceConfig;
|
|
|
|
if (typeof config === 'function') {
|
|
const context: InterfaceContext = { i18n };
|
|
options = config(context);
|
|
} else {
|
|
options = config;
|
|
}
|
|
|
|
return options;
|
|
}
|