@@ -10,7 +10,7 @@ export interface Aleph {
10
10
fetchModule ( specifier : string ) : Promise < { content : Uint8Array , contentType : string | null } >
11
11
onResolve ( test : RegExp , resolve : ( specifier : string ) => ResolveResult ) : void
12
12
onLoad ( test : RegExp , load : ( input : LoadInput ) => LoadOutput | Promise < LoadOutput > ) : void
13
- onTransform ( test : 'hmr' | 'mainscript ' | RegExp , transform : ( input : TransformInput ) => TransformOutput ) : void
13
+ onTransform ( test : 'hmr' | 'main ' | RegExp , transform : ( input : TransformInput ) => TransformOutput ) : void
14
14
onSSR ( callback : ( path : string , html : string ) => { html : string } ) : void
15
15
}
16
16
@@ -64,7 +64,7 @@ type RouteBasicInfo = {
64
64
}
65
65
66
66
/**
67
- * The result from the `onResolve` listener .
67
+ * The result from the `onResolve` hook .
68
68
*/
69
69
export type ResolveResult = {
70
70
specifier ?: string
@@ -75,28 +75,28 @@ export type ResolveResult = {
75
75
}
76
76
77
77
/**
78
- * The input to the `onLoad` listener .
78
+ * The input to the `onLoad` hook .
79
79
*/
80
80
export type LoadInput = {
81
81
specifier : string
82
82
data ?: any
83
83
}
84
84
85
85
/**
86
- * The output of the `onLoad` listener .
86
+ * The output of the `onLoad` hook .
87
87
*/
88
88
export type LoadOutput = {
89
89
/** The transformed code type (default is 'js'). */
90
90
type ?: 'css' | 'js' | 'jsx' | 'ts' | 'tsx'
91
91
/** The transformed code. */
92
92
code : string
93
- /** The source map. */
93
+ /** The source map if available . */
94
94
map ?: string
95
95
}
96
96
97
97
98
98
/**
99
- * The input to the `onTransform` listener .
99
+ * The input to the `onTransform` hook .
100
100
*/
101
101
export type TransformInput = {
102
102
specifier : string
@@ -105,7 +105,7 @@ export type TransformInput = {
105
105
}
106
106
107
107
/**
108
- * The output of the `onTransform` listener .
108
+ * The output of the `onTransform` hook .
109
109
*/
110
110
export type TransformOutput = {
111
111
code : string
0 commit comments