11declare module '@i18n-macro' {
2- /** load i18n resources by glob pattern. */
3- export function loadI18n ( glob ?: string ) : void
4- /** load i18n resources by glob pattern. */
5- export function loadI18nWithNS ( ns : string , glob ?: string ) : void
6- import { UseTranslationResponse } from 'react-i18next'
7- /** a wrapper of useTranslation(), with auto namespace management. */
8- export function useI18n ( ) : UseTranslationResponse < '' >
9- import { TFunction } from 'i18next'
10- /** a wrapper of i18next.t(), with auto namespace management. */
11- export function getI18n ( ) : TFunction
12- /** get the i18n namespace for the current file. */
13- export function resolveNamespace ( ) : string
2+ /** load i18n resources by glob pattern. */
3+ export function loadI18n ( glob ?: string ) : void
4+ /** load i18n resources by glob pattern. */
5+ export function loadI18nWithNS ( ns : string , glob ?: string ) : void
6+ import { UseTranslationResponse } from 'react-i18next'
7+ /** a wrapper of useTranslation(), with auto namespace management. */
8+ export function useI18n ( ) : UseTranslationResponse < '' >
9+ import { TFunction } from 'i18next'
10+ /** a wrapper of i18next.t(), with auto namespace management. */
11+ export function getI18n ( ) : TFunction
12+ /** get the i18n namespace for the current file. */
13+ export function resolveNamespace ( ) : string
1414}
1515declare module '@i18n-macro-helper' {
16- import { TFunction } from 'i18next'
17- export function onI18nInitialized ( hook : ( ) => void ) : void
18- export function withNamespace ( ns : string | string [ ] ) : TFunction
16+
17+ import { TFunction } from 'i18next'
18+ export function onI18nInitialized ( hook : ( ) => void ) : void ;
19+ export function withNamespace ( ns : string | string [ ] ) : TFunction ;
20+
1921}
2022declare module '@assets-macro' {
21- /** import all assets by glob pattern. */
22- export function importAssets ( glob : string ) : void
23+ /** import all assets by glob pattern. */
24+ export function importAssets ( glob : string ) : void
2325}
2426declare module '@pages-macro' {
25- import { ComponentType } from 'react'
26- export interface IRoute < T > {
27- id : string
28- defaultName : string
29- path : string
30- exact : boolean
31- sync : boolean
32- component : ComponentType < any >
33- meta : T
34- children : IRoute < T > [ ]
35- }
36- /** get routes tree by the path of the root directory of pages and the prefix of target routes. */
37- export function loadRoutes < T > ( pagesPath : string , prefix ?: string ) : IRoute < T >
3827
39- export interface IMenuItem < T > {
40- id : string
41- defaultName : string
42- path : string
43- meta : T
44- children : IMenuItem < T > [ ]
45- }
46- /** get menu tree by the path of the root directory of pages and the route prefix of these menus.
28+ import { ComponentType } from 'react'
29+ export interface IRoute < T > {
30+ id : string
31+ defaultName : string
32+ path : string
33+ exact : boolean
34+ sync : boolean
35+ component : ComponentType < any >
36+ meta : T
37+ children : IRoute < T > [ ]
38+ }
39+ /** get routes tree by the path of the root directory of pages and the prefix of target routes. */
40+ export function loadRoutes < T > ( pagesPath : string , prefix ?: string ) : IRoute < T >
41+
42+ export interface IMenuItem < T > {
43+ id : string
44+ defaultName : string
45+ path : string
46+ meta : T
47+ children : IMenuItem < T > [ ]
48+ }
49+ /** get menu tree by the path of the root directory of pages and the route prefix of these menus.
4750if prefix is left unset, the route of the current file will be used as the route prefix of the menus. */
48- export function loadMenus < T > (
49- pagesPath : string ,
50- prefix ?: string
51- ) : IMenuItem < T > [ ]
52- /** get the route path by relative path.
51+ export function loadMenus < T > ( pagesPath : string , prefix ?: string ) : IMenuItem < T > [ ]
52+ /** get the route path by relative path.
5353if relativePath is left unset, returns the route path of current file. */
54- export function resolveRoute (
55- relativePath ?: string ,
56- ...params : string [ ]
57- ) : string
54+ export function resolveRoute ( relativePath ?: string , ...params : string [ ] ) : string
5855}
5956declare module '@components-macro' {
60- import { ReactElement , ComponentType } from 'react'
61- export function wrap (
62- target : ReactElement ,
63- ...wrappers : ComponentType [ ]
64- ) : ReactElement
65- }
57+ import { ReactElement , ComponentType } from 'react'
58+ export function wrap ( target : ReactElement , ...wrappers : ComponentType [ ] ) : ReactElement
59+ }
0 commit comments