Skip to main content

internal_

runtime / <internal>

Namespace: <internal>

Table of contents

Namespaces

Enumerations

Classes

Interfaces

Type aliases

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

NameType
Ivoid
Evoid
Rvoid

Type declaration

NameType
runRemoveVoidParameter<(initalValue: I, extraArg: E) => Promise<R[]>>
typestring
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
NameType
initalValueI
extraArgsE
Returns

Promise<R> | R


AsyncSeriesWaterfallHook

Ƭ AsyncSeriesWaterfallHook<I, E>: Object

Has return value with given type

Type parameters

NameType
Ivoid
Evoid

Type declaration

NameType
runRemoveVoidParameter<(initalValue: I, extraArgs: E) => Promise<I>>
typestring
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
NameType
initalValueI
extraArgE
Returns

Promise<I> | I


BuiltinRuntimePluginHooks

Ƭ BuiltinRuntimePluginHooks: typeof builtinRuntimePluginHooks


DynamicOptions

Ƭ DynamicOptions<P>: LoadableBaseOptions<P>

Type parameters

NameType
P{}

Events

Ƭ Events<F>: Object

Type parameters

Name
F

Type declaration

NameType
lengthnumber
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

NameType
HMextends HookMap
CC
EHMextends HookMap

Type declaration

NameType
hooksHM | HM & EHM
runnerRunnerType<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

NameType
Tany

Type declaration

NameType
jsonSend<T>
sendSend<T>
redirect(url: string) => IResponse(status: number, url: string) => IResponse
status(statusCode: number) => IResponse

IApiResponse

Ƭ IApiResponse<T>: ServerResponse & IApiRes<T>

Type parameters

NameType
Tany

IApplicationCreaterContext

Ƭ IApplicationCreaterContext: IApplicationCreaterClientContext | IApplicationCreaterServerContext


IErrorHandler

Ƭ IErrorHandler: (errorCode?: SHUVI_ERROR_CODE | string, errorDesc?: string) => void

Type declaration

▸ (errorCode?, errorDesc?): void

Parameters
NameType
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
NameType
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

NameType
AppComponent?any
UserAppComponent?any

IRouteComponent

Ƭ IRouteComponent<C, P>: C & { getInitialProps?: (context: IRouteComponentContext) => P | Promise<P> }

Type parameters

NameType
CC
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

NameType
P{}

LoadableGeneratedOptions

Ƭ LoadableGeneratedOptions: Object

Type declaration

NameType
modules?string[]
webpack?() => string[]

Loader

Ƭ Loader<P>: () => LoaderComponent<P>

Type parameters

NameType
P{}

Type declaration

▸ (): LoaderComponent<P>

Returns

LoaderComponent<P>


LoaderComponent

Ƭ LoaderComponent<P>: Promise<React.ComponentType<P> | { default: React.ComponentType<P> }>

Type parameters

NameType
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

NameType
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
NameType
bodyT
Returns

void


Setup

Ƭ Setup<EHM>: (utils: { addHooks: (hook: Partial<EHM>) => void }) => void

Type parameters

Name
EHM

Type declaration

▸ (utils): void

Parameters
NameType
utilsObject
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

NameType
Ivoid
Evoid
RI

Type declaration

NameType
runRemoveVoidParameter<SyncBailHookHandler<I, E, R>>
typestring
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
NameType
initalValueI
extraArgE
Returns

R | undefined | void


SyncHook

Ƭ SyncHook<I, E, R>: Object

Normal hook.

Type parameters

NameType
Ivoid
Evoid
Rvoid

Type declaration

NameType
runRemoveVoidParameter<(initalValue: I, extraArg: E) => R[]>
typestring
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
NameType
initalValueI
extraArgE
Returns

R


SyncWaterfallHook

Ƭ SyncWaterfallHook<I, E>: Object

Has return value with given type

Type parameters

NameType
II
Evoid

Type declaration

NameType
runRemoveVoidParameter<SyncWaterfallHookHandler<I, E>>
typestring
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
NameType
initalValueI
extraArgsE
Returns

I


WithRouterProps

Ƭ WithRouterProps: Object

Type declaration

NameType
routerIRouter

Variables

builtinRuntimePluginHooks

Const builtinRuntimePluginHooks: Object

Type declaration

NameType
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"