internal_
runtime / <internal>
Namespace: <internal>
Table of contents
Namespaces
Enumerations
Classes
Interfaces
- CustomRuntimePluginHooks
- HookMap
- IApiModule
- IApiReq
- IAppComponent
- IApplicationCreaterBase
- IApplicationCreaterClientContext
- IApplicationCreaterServerContext
- IApplicationOptions
- IClientRendererOptions
- IContext
- IHtmlTag
- IIncomingMessage
- IPathMatch
- IRedirectFn
- IRedirectState
- IRedirector
- IRenderOptions
- IRequest
- IResponse
- IRouteBaseObject
- IRouteComponentContext
- IRouteMatch
- IRouter
- IRouterOptions
- IServerAppContext
- IView
- LinkProps
- NavigationGuardHookWithContext
- PartialLocation
- PushOptions
- TransitionOptions
Type aliases
- AddContextParameter
- AnyHook
- AsyncParallelHook
- AsyncParallelHookHandler
- AsyncSeriesWaterfallHook
- AsyncSeriesWaterfallHookHandler
- BuiltinRuntimePluginHooks
- DynamicOptions
- Events
- ExcludeRouterProps
- HeadState
- HookManager
- HookRunnerType
- IApiRequest
- IApiRes
- IApiResponse
- IApplicationCreaterContext
- IErrorHandler
- IHtmlAttrs
- INextFunc
- IPathPattern
- IPluginHandlers
- IPluginHandlersFullMap
- IPluginInstance
- IQuery
- IRerenderConfig
- IRouteComponent
- IRouteComponentProps
- IRuntimeConfig
- IRuntimePluginConstructor
- LoadableBaseOptions
- LoadableGeneratedOptions
- Loader
- LoaderComponent
- PatchPluginParameter
- PathParserOptions
- PluginOptions
- RemoveManagerVoidParameter
- RemoveVoidParameter
- RunnerType
- Send
- Setup
- State
- SyncBailHook
- SyncBailHookHandler
- SyncHook
- SyncHookHandler
- SyncWaterfallHook
- SyncWaterfallHookHandler
- WithRouterProps
Variables
Type aliases
AddContextParameter
Ƭ AddContextParameter<T, C>: T extends (initalValue: infer I, extraArg: infer E) => infer R ? (initalValue: I, extraArg: E, context: C) => R : T
Type parameters
| Name |
|---|
T |
C |
AnyHook
Ƭ AnyHook: SyncHook<any, any, any> | SyncBailHook<any, any, any> | SyncWaterfallHook<any, any> | AsyncParallelHook<any, any, any> | AsyncSeriesWaterfallHook<any, any>
AsyncParallelHook
Ƭ AsyncParallelHook<I, E, R>: Object
Normal async hook. No return value
RemoveVoidParameter<( null extends R ? (R extends void ? ((initalValue: I, extraArg: E) => Promise<R[]>) : ((initalValue: I, extraArg: E) => Promise<R[]>)) : ((initalValue: I, extraArg: E) => Promise<R[]>) )>
Type parameters
| Name | Type |
|---|---|
I | void |
E | void |
R | void |
Type declaration
| Name | Type |
|---|---|
run | RemoveVoidParameter<(initalValue: I, extraArg: E) => Promise<R[]>> |
type | string |
clear | () => void |
use | (...handlers: null extends I ? I & null extends E ? (initialValue: I, extraArg: E) => R | Promise<R> : void extends E ? (initialValue: I) => R | Promise<R> : (initialValue: I, extraArg: E) => R | Promise<R> : void extends I ? null extends E ? (extraArg: E) => R | Promise<R> : I & void extends E ? () => R | Promise<R> : (extraArg: E) => R | Promise<R> : null extends E ? (initialValue: I, extraArg: E) => R | Promise<R> : void extends E ? (initialValue: I) => R | Promise<R> : (initialValue: I, extraArg: E) => R | Promise<R>[]) => void |
AsyncParallelHookHandler
Ƭ AsyncParallelHookHandler<I, E, R>: (initalValue: I, extraArgs: E) => Promise<R> | R
Type parameters
| Name |
|---|
I |
E |
R |
Type declaration
▸ (initalValue, extraArgs): Promise<R> | R
Parameters
| Name | Type |
|---|---|
initalValue | I |
extraArgs | E |
Returns
Promise<R> | R
AsyncSeriesWaterfallHook
Ƭ AsyncSeriesWaterfallHook<I, E>: Object
Has return value with given type
Type parameters
| Name | Type |
|---|---|
I | void |
E | void |
Type declaration
| Name | Type |
|---|---|
run | RemoveVoidParameter<(initalValue: I, extraArgs: E) => Promise<I>> |
type | string |
clear | () => void |
use | (...handlers: null extends I ? I & null extends E ? (initialValue: I, extraArg: E) => I | Promise<I> : void extends E ? (initialValue: I) => I | Promise<I> : (initialValue: I, extraArg: E) => I | Promise<I> : void extends I ? null extends E ? (extraArg: E) => I | Promise<I> : I & void extends E ? () => I | Promise<I> : (extraArg: E) => I | Promise<I> : null extends E ? (initialValue: I, extraArg: E) => I | Promise<I> : void extends E ? (initialValue: I) => I | Promise<I> : (initialValue: I, extraArg: E) => I | Promise<I>[]) => void |
AsyncSeriesWaterfallHookHandler
Ƭ AsyncSeriesWaterfallHookHandler<I, E>: (initalValue: I, extraArg: E) => Promise<I> | I
Type parameters
| Name |
|---|
I |
E |
Type declaration
▸ (initalValue, extraArg): Promise<I> | I
Parameters
| Name | Type |
|---|---|
initalValue | I |
extraArg | E |
Returns
Promise<I> | I
BuiltinRuntimePluginHooks
Ƭ BuiltinRuntimePluginHooks: typeof builtinRuntimePluginHooks
DynamicOptions
Ƭ DynamicOptions<P>: LoadableBaseOptions<P>
Type parameters
| Name | Type |
|---|---|
P | {} |
Events
Ƭ Events<F>: Object
Type parameters
| Name |
|---|
F |
Type declaration
| Name | Type |
|---|---|
length | number |
call | (...arg: any) => void |
push | (fn: F) => RemoveListenerCallback |
toArray | () => F[] |
ExcludeRouterProps
Ƭ ExcludeRouterProps<P>: Pick<P, Exclude<keyof P, keyof WithRouterProps>>
Type parameters
| Name |
|---|
P |
HeadState
Ƭ HeadState: IHtmlTag[]
HookManager
Ƭ HookManager<HM, C, EHM>: Object
Type parameters
| Name | Type |
|---|---|
HM | extends HookMap |
C | C |
EHM | extends HookMap |
Type declaration
| Name | Type |
|---|---|
hooks | HM | HM & EHM |
runner | RunnerType<HM, EHM> |
addHooks | (hook: Partial<EHM>) => void |
clear | () => void |
createPlugin | (pluginHandlers: Partial<IPluginHandlersFullMap<HM & EHM, C>> & { setup?: Setup<EHM> }, options?: PluginOptions) => IPluginInstance<HM & EHM, C> |
getPlugins | () => IPluginInstance<HM & EHM, C>[] |
setContext | (context: C) => void |
usePlugin | (...plugins: IPluginInstance<HM & EHM, C>[]) => void |
HookRunnerType
Ƭ HookRunnerType<H>: H extends SyncHook<infer T, infer E, infer R> ? SyncHook<T, E, R>["run"] : H extends SyncBailHook<infer T, infer E, infer R> ? SyncBailHook<T, E, R>["run"] : H extends SyncWaterfallHook<infer T, infer E> ? SyncWaterfallHook<T, E>["run"] : H extends AsyncParallelHook<infer T, infer E, infer R> ? AsyncParallelHook<T, E, R>["run"] : H extends AsyncSeriesWaterfallHook<infer T, infer E> ? AsyncSeriesWaterfallHook<T, E>["run"] : never
Type parameters
| Name |
|---|
H |
IApiRequest
Ƭ IApiRequest: IRequest & IApiReq
IApiRes
Ƭ IApiRes<T>: Object
Type parameters
| Name | Type |
|---|---|
T | any |
Type declaration
| Name | Type |
|---|---|
json | Send<T> |
send | Send<T> |
redirect | (url: string) => IResponse(status: number, url: string) => IResponse |
status | (statusCode: number) => IResponse |
IApiResponse
Ƭ IApiResponse<T>: ServerResponse & IApiRes<T>
Type parameters
| Name | Type |
|---|---|
T | any |
IApplicationCreaterContext
Ƭ IApplicationCreaterContext: IApplicationCreaterClientContext | IApplicationCreaterServerContext
IErrorHandler
Ƭ IErrorHandler: (errorCode?: SHUVI_ERROR_CODE | string, errorDesc?: string) => void
Type declaration
▸ (errorCode?, errorDesc?): void
Parameters
| Name | Type |
|---|---|
errorCode? | SHUVI_ERROR_CODE | string |
errorDesc? | string |
Returns
void
IHtmlAttrs
Ƭ IHtmlAttrs: { textContent?: string } & { [x: string]: string | number | undefined | boolean; }
INextFunc
Ƭ INextFunc: (err?: any) => void
Type declaration
▸ (err?): void
Parameters
| Name | Type |
|---|---|
err? | any |
Returns
void
IPathPattern
Ƭ IPathPattern: string | { caseSensitive?: boolean ; end?: boolean ; path: string }
IPluginHandlers
Ƭ IPluginHandlers<HM, C>: Partial<IPluginHandlersFullMap<HM, C>>
Type parameters
| Name |
|---|
HM |
C |
IPluginHandlersFullMap
Ƭ IPluginHandlersFullMap<HM, C>: { [K in keyof HM]: HM[K] extends SyncHook<infer T, infer E, infer R> ? PatchPluginParameter<SyncHookHandler<T, E, R>, C> : HM[K] extends SyncBailHook<infer T, infer E, infer R> ? PatchPluginParameter<SyncBailHookHandler<T, E, R>, C> : HM[K] extends SyncWaterfallHook<infer T, infer E> ? PatchPluginParameter<SyncWaterfallHookHandler<T, E>, C> : HM[K] extends AsyncParallelHook<infer T, infer E, infer R> ? PatchPluginParameter<AsyncParallelHookHandler<T, E, R>, C> : HM[K] extends AsyncSeriesWaterfallHook<infer T, infer E> ? PatchPluginParameter<AsyncSeriesWaterfallHookHandler<T, E>, C> : never }
Type parameters
| Name |
|---|
HM |
C |
IPluginInstance
Ƭ IPluginInstance<HM, C>: { SYNC_PLUGIN_SYMBOL: "SYNC_PLUGIN_SYMBOL" ; handlers: IPluginHandlers<HM, C> } & PluginOptions
Type parameters
| Name |
|---|
HM |
C |
IQuery
Ƭ IQuery: ParsedQuery
IRerenderConfig
Ƭ IRerenderConfig: Object
Type declaration
| Name | Type |
|---|---|
AppComponent? | any |
UserAppComponent? | any |
IRouteComponent
Ƭ IRouteComponent<C, P>: C & { getInitialProps?: (context: IRouteComponentContext) => P | Promise<P> }
Type parameters
| Name | Type |
|---|---|
C | C |
P | {} |
IRouteComponentProps
Ƭ IRouteComponentProps: Record<string, string>
IRuntimeConfig
Ƭ IRuntimeConfig: Record<string, string>
IRuntimePluginConstructor
Ƭ IRuntimePluginConstructor: IPluginHandlers<BuiltinRuntimePluginHooks & CustomRuntimePluginHooks, void>
LoadableBaseOptions
Ƭ LoadableBaseOptions<P>: LoadableGeneratedOptions & { loader?: Loader<P> ; ssr?: boolean ; loading?: (__namedParameters: { error?: Error | null ; isLoading?: boolean ; pastDelay?: boolean ; timedOut?: boolean }) => null | Element }
Type parameters
| Name | Type |
|---|---|
P | {} |
LoadableGeneratedOptions
Ƭ LoadableGeneratedOptions: Object
Type declaration
| Name | Type |
|---|---|
modules? | string[] |
webpack? | () => string[] |
Loader
Ƭ Loader<P>: () => LoaderComponent<P>
Type parameters
| Name | Type |
|---|---|
P | {} |
Type declaration
▸ (): LoaderComponent<P>
Returns
LoaderComponent
Ƭ LoaderComponent<P>: Promise<React.ComponentType<P> | { default: React.ComponentType<P> }>
Type parameters
| Name | Type |
|---|---|
P | {} |
PatchPluginParameter
Ƭ PatchPluginParameter<T, C>: RemoveManagerVoidParameter<AddContextParameter<T, C>>
Type parameters
| Name |
|---|
T |
C |
PathParserOptions
Ƭ PathParserOptions: Pick<_PathParserOptions, "end" | "sensitive" | "strict">
PluginOptions
Ƭ PluginOptions: Object
Index signature
▪ [x: string]: any
Type declaration
| Name | Type |
|---|---|
name? | string |
order? | number |
post? | string[] |
pre? | string[] |
required? | string[] |
rivals? | string[] |
RemoveManagerVoidParameter
Ƭ RemoveManagerVoidParameter<T>: T extends (initalValue: infer I, extraArg: infer E, context: infer C) => infer R ? null extends I ? null extends E ? null extends C ? (initialValue: I, extraArg: E, context: C) => R : void extends C ? (initialValue: I, extraArg: E) => R : (initialValue: I, extraArg: E, context: C) => R : void extends E ? null extends C ? (initialValue: I, context: C) => R : void extends C ? (initialValue: I) => R : (initialValue: I, context: C) => R : null extends C ? (initialValue: I, extraArg: E, context: C) => R : void extends C ? (initialValue: I, extraArg: E) => R : (initialValue: I, extraArg: E, context: C) => R : void extends I ? null extends E ? null extends C ? (extraArg: E, context: C) => R : void extends C ? (extraArg: E) => R : (extraArg: E, context: C) => R : void extends E ? null extends C ? (context: C) => R : void extends C ? () => R : (context: C) => R : null extends C ? (extraArg: E, context: C) => R : void extends C ? (extraArg: E) => R : (extraArg: E, context: C) => R : null extends E ? null extends C ? (initialValue: I, extraArg: E, context: C) => R : void extends C ? (initialValue: I, extraArg: E) => R : (initialValue: I, extraArg: E, context: C) => R : void extends E ? null extends C ? (initialValue: I, context: C) => R : void extends C ? (initialValue: I) => R : (initialValue: I, context: C) => R : null extends C ? (initialValue: I, extraArg: E, context: C) => R : void extends C ? (initialValue: I, extraArg: E) => R : (initialValue: I, extraArg: E, context: C) => R : T
Type parameters
| Name |
|---|
T |
RemoveVoidParameter
Ƭ RemoveVoidParameter<T>: T extends (initalValue: infer I, extraArg: infer E) => infer R ? null extends I ? null extends E ? (initialValue: I, extraArg: E) => R : void extends E ? (initialValue: I) => R : (initialValue: I, extraArg: E) => R : void extends I ? null extends E ? (extraArg: E) => R : void extends E ? () => R : (extraArg: E) => R : null extends E ? (initialValue: I, extraArg: E) => R : void extends E ? (initialValue: I) => R : (initialValue: I, extraArg: E) => R : T
Type parameters
| Name |
|---|
T |
RunnerType
Ƭ RunnerType<HM, EHM>: { [K in keyof HM & EHM]: HookRunnerType<HM & EHM[K]> } & { setup: Setup<EHM> }
Type parameters
| Name |
|---|
HM |
EHM |
Send
Ƭ Send<T>: (body: T) => void
Type parameters
| Name |
|---|
T |
Type declaration
▸ (body): void
Parameters
| Name | Type |
|---|---|
body | T |
Returns
void
Setup
Ƭ Setup<EHM>: (utils: { addHooks: (hook: Partial<EHM>) => void }) => void
Type parameters
| Name |
|---|
EHM |
Type declaration
▸ (utils): void
Parameters
| Name | Type |
|---|---|
utils | Object |
utils.addHooks | (hook: Partial<EHM>) => void |
Returns
void
State
Ƭ State: object | null
An object that is used to associate some arbitrary data with a location, but that does not appear in the URL path.
SyncBailHook
Ƭ SyncBailHook<I, E, R>: Object
Has return value with any type
Type parameters
| Name | Type |
|---|---|
I | void |
E | void |
R | I |
Type declaration
| Name | Type |
|---|---|
run | RemoveVoidParameter<SyncBailHookHandler<I, E, R>> |
type | string |
clear | () => void |
use | (...handlers: null extends I ? I & null extends E ? (initialValue: I, extraArg: E) => undefined | void | R : void extends E ? (initialValue: I) => undefined | void | R : (initialValue: I, extraArg: E) => undefined | void | R : void extends I ? null extends E ? (extraArg: E) => undefined | void | R : I & void extends E ? () => undefined | void | R : (extraArg: E) => undefined | void | R : null extends E ? (initialValue: I, extraArg: E) => undefined | void | R : void extends E ? (initialValue: I) => undefined | void | R : (initialValue: I, extraArg: E) => undefined | void | R[]) => void |
SyncBailHookHandler
Ƭ SyncBailHookHandler<I, E, R>: (initalValue: I, extraArg: E) => R | undefined | void
Type parameters
| Name |
|---|
I |
E |
R |
Type declaration
▸ (initalValue, extraArg): R | undefined | void
Parameters
| Name | Type |
|---|---|
initalValue | I |
extraArg | E |
Returns
R | undefined | void
SyncHook
Ƭ SyncHook<I, E, R>: Object
Normal hook.
Type parameters
| Name | Type |
|---|---|
I | void |
E | void |
R | void |
Type declaration
| Name | Type |
|---|---|
run | RemoveVoidParameter<(initalValue: I, extraArg: E) => R[]> |
type | string |
clear | () => void |
use | (...handlers: null extends I ? I & null extends E ? (initialValue: I, extraArg: E) => R : void extends E ? (initialValue: I) => R : (initialValue: I, extraArg: E) => R : void extends I ? null extends E ? (extraArg: E) => R : I & void extends E ? () => R : (extraArg: E) => R : null extends E ? (initialValue: I, extraArg: E) => R : void extends E ? (initialValue: I) => R : (initialValue: I, extraArg: E) => R[]) => void |
SyncHookHandler
Ƭ SyncHookHandler<I, E, R>: (initalValue: I, extraArg: E) => R
Type parameters
| Name |
|---|
I |
E |
R |
Type declaration
▸ (initalValue, extraArg): R
Parameters
| Name | Type |
|---|---|
initalValue | I |
extraArg | E |
Returns
R
SyncWaterfallHook
Ƭ SyncWaterfallHook<I, E>: Object
Has return value with given type
Type parameters
| Name | Type |
|---|---|
I | I |
E | void |
Type declaration
| Name | Type |
|---|---|
run | RemoveVoidParameter<SyncWaterfallHookHandler<I, E>> |
type | string |
clear | () => void |
use | (...handlers: null extends I ? I & null extends E ? (initialValue: I, extraArg: E) => I : void extends E ? (initialValue: I) => I : (initialValue: I, extraArg: E) => I : void extends I ? null extends E ? (extraArg: E) => I : I & void extends E ? () => I : (extraArg: E) => I : null extends E ? (initialValue: I, extraArg: E) => I : void extends E ? (initialValue: I) => I : (initialValue: I, extraArg: E) => I[]) => void |
SyncWaterfallHookHandler
Ƭ SyncWaterfallHookHandler<I, E>: (initalValue: I, extraArgs: E) => I
Type parameters
| Name |
|---|
I |
E |
Type declaration
▸ (initalValue, extraArgs): I
Parameters
| Name | Type |
|---|---|
initalValue | I |
extraArgs | E |
Returns
I
WithRouterProps
Ƭ WithRouterProps: Object
Type declaration
| Name | Type |
|---|---|
router | IRouter |
Variables
builtinRuntimePluginHooks
• Const builtinRuntimePluginHooks: Object
Type declaration
| Name | Type |
|---|---|
dispose | "@shuvi/hook/lib/index" |
getAppComponent | "@shuvi/hook/lib/index" |
getAppContext | "@shuvi/hook/lib/index" |
getRootAppComponent | "@shuvi/hook/lib/index" |
init | "@shuvi/hook/lib/index" |