( handlers: MaybeArray<(...args: A) => void> | undefined, ...args: A )
| 372 | } |
| 373 | |
| 374 | export function emitEvent<A extends any[]>( |
| 375 | handlers: MaybeArray<(...args: A) => void> | undefined, |
| 376 | ...args: A |
| 377 | ) { |
| 378 | if (Array.isArray(handlers)) { |
| 379 | for (let i = 0, len = handlers.length; i < len; ++i) { |
| 380 | const handler = handlers[i] |
| 381 | |
| 382 | typeof handler === 'function' && handler(...args) |
| 383 | } |
| 384 | } else { |
| 385 | typeof handlers === 'function' && handlers(...args) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | export function localeProp<N extends LocaleNames>(_name: N) { |
| 390 | return Object as PropType<Partial<LocaleConfig[N]>> |
no test coverage detected