4545
4646Ƭ ** AbstractPath** : { toString: () => string }
4747
48- * Defined in [ types.ts:29] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0/src/types.ts#L29 ) *
48+ * Defined in [ types.ts:32] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L32 ) *
49+
50+ An abstract way to specify a path. It could be a simple string or a object like an URL. An AbstractPath must always be convertible to a string.
4951
5052#### Type declaration:
5153
5961
6062Ƭ ** Cache** : { get: (key: string) => Promise<string\> ; set: (key: string, value: string) => Promise<void\> }
6163
62- * Defined in [ types.ts:20] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L20 ) *
64+ * Defined in [ types.ts:20] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L20 ) *
6365
6466#### Type declaration:
6567
7476
7577Ƭ ** ContentData** : string \| ArrayBuffer
7678
77- * Defined in [ types.ts:71] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L71 ) *
79+ * Defined in [ types.ts:71] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L71 ) *
7880
7981___
8082
8183### CustomBlock
8284
8385Ƭ ** CustomBlock** : { attrs: Record<string, string \| true\> ; content: string ; type: string }
8486
85- * Defined in [ types.ts:109] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L109 ) *
87+ * Defined in [ types.ts:109] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L109 ) *
8688
8789A custom block
8890
100102
101103Ƭ ** CustomBlockCallback** : (component: [ ModuleExport] ( README.md#moduleexport ) ) => void
102104
103- * Defined in [ types.ts:103] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L103 ) *
105+ * Defined in [ types.ts:103] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L103 ) *
104106
105107CustomBlockCallback function type
106108
110112
111113Ƭ ** File** : { getContentData: (asBinary: Boolean) => Promise<[ ContentData] ( README.md#contentdata ) \> ; type: string }
112114
113- * Defined in [ types.ts:77] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L77 ) *
115+ * Defined in [ types.ts:77] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L77 ) *
114116
115117Represents a file content and the extension name.
116118
@@ -127,15 +129,15 @@ ___
127129
128130Ƭ ** LangProcessor** : (source: string, preprocessOptions?: any) => Promise<string\> \| string
129131
130- * Defined in [ types.ts:399] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L399 ) *
132+ * Defined in [ types.ts:399] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L399 ) *
131133
132134___
133135
134136### Module
135137
136138Ƭ ** Module** : { exports: [ ModuleExport] ( README.md#moduleexport ) }
137139
138- * Defined in [ types.ts:129] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L129 ) *
140+ * Defined in [ types.ts:129] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L129 ) *
139141
140142This just represents a loaded js module
141143
@@ -151,15 +153,15 @@ ___
151153
152154Ƭ ** ModuleCacheId** : string
153155
154- * Defined in [ types.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L26 ) *
156+ * Defined in [ types.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L26 ) *
155157
156158___
157159
158160### ModuleExport
159161
160162Ƭ ** ModuleExport** : {}
161163
162- * Defined in [ types.ts:123] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L123 ) *
164+ * Defined in [ types.ts:123] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L123 ) *
163165
164166This just represents a loaded js module exports
165167
@@ -169,12 +171,13 @@ ___
169171
170172Ƭ ** ModuleHandler** : (type: string, getContentData: File[ \" getContentData\" ] , path: [ AbstractPath] ( README.md#abstractpath ) , options: [ Options] ( README.md#options ) ) => Promise<[ ModuleExport] ( README.md#moduleexport ) \| null\>
171173
172- * Defined in [ types.ts:68] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0/src/types.ts#L68 ) *
174+ * Defined in [ types.ts:68] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L68 ) *
175+
176+ Used by the library when it needs to handle a does not know how to handle a given file type (eg. ` .json ` files).
173177
174- Used by the library when it does not know how to handle a given file type (eg. ` .json ` files).
175- see [[ moduleHandlers]]
178+ ** ` param ` ** The type of the file. It can be anything, but must be '.vue', '.js' or '.mjs' for vue, js and esm files.
176179
177- ** ` param ` ** The content of the file
180+ ** ` param ` ** The method to get the content data of a file (text or binary). see [[ File [ 'getContentData' ] ]]
178181
179182** ` param ` ** The path of the file
180183
@@ -184,9 +187,6 @@ see [[moduleHandlers]]
184187
185188``` javascript
186189 ...
187- moduleHandlers: {
188- ' .json ' : (source , path , options ) => JSON .parse (source),
189- }
190190 ...
191191```
192192
196196
197197Ƭ **Options**: { additionalBabelParserPlugins?: babel\_ParserPlugin[] ; additionalBabelPlugins?: Record<string, any\> ; compiledCache?: [Cache](README.md#cache) ; delimiters?: [string, string] ; handleModule?: [ModuleHandler](README.md#modulehandler) ; moduleCache: Record<[ModuleCacheId](README.md#modulecacheid), LoadingType<[ModuleExport](README.md#moduleexport)\> \| [ModuleExport](README.md#moduleexport)\> ; pathResolve: [PathResolve](README.md#pathresolve) ; addStyle: (style: string, scopeId: string \| undefined) => void ; customBlockHandler?: (block: [CustomBlock](README.md#customblock), filename: [AbstractPath](README.md#abstractpath), options: [Options](README.md#options)) => Promise<[CustomBlockCallback](README.md#customblockcallback) \| undefined\> ; getFile: (path: [AbstractPath](README.md#abstractpath)) => Promise<[File](README.md#file) \| [ContentData](README.md#contentdata)\> ; getResource: (pathCx: [PathContext](README.md#pathcontext), options: [Options](README.md#options)) => [Resource](README.md#resource) ; loadModule?: (path: [AbstractPath](README.md#abstractpath), options: [Options](README.md#options)) => Promise<[ModuleExport](README.md#moduleexport) \| undefined\> ; log?: (type: string, ...data: any[]) => void }
198198
199- * Defined in [ types.ts:140] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L140 ) *
199+ * Defined in [ types.ts:140] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L140 ) *
200200
201201#### Type declaration:
202202
222222
223223Ƭ ** PathContext** : { refPath: [ AbstractPath] ( README.md#abstractpath ) ; relPath: [ AbstractPath] ( README.md#abstractpath ) }
224224
225- * Defined in [ types.ts:38 ] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L38 ) *
225+ * Defined in [ types.ts:41 ] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L41 ) *
226226
227227A PathContext represents a path (relPath) relative to an abolute path (refPath)
228228Note that relPath is not necessary relative, but it is, relPath is relative to refPath.
240240
241241Ƭ ** PathResolve** : (pathCx: [ PathContext] ( README.md#pathcontext ) ) => [ AbstractPath] ( README.md#abstractpath )
242242
243- * Defined in [ types.ts:47 ] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L47 ) *
243+ * Defined in [ types.ts:50 ] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L50 ) *
244244
245245relative to absolute module path resolution
246246
@@ -250,15 +250,15 @@ ___
250250
251251Ƭ ** Resource** : { getContent: () => Promise<[ File] ( README.md#file ) \> ; id: [ ModuleCacheId] ( README.md#modulecacheid ) ; path: [ AbstractPath] ( README.md#abstractpath ) }
252252
253- * Defined in [ types.ts:88] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/types.ts#L88 ) *
253+ * Defined in [ types.ts:88] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/types.ts#L88 ) *
254254
255255Represents a resource.
256256
257257#### Type declaration:
258258
259259Name | Type | Description |
260260------ | ------ | ------ |
261- ` getContent ` | () => Promise<[ File] ( README.md#file ) \> | asynchronously get the content of the resource |
261+ ` getContent ` | () => Promise<[ File] ( README.md#file ) \> | asynchronously get the content of the resource. Once you got the content, you can asynchronously get the data through the getContentData(asBinary) method. |
262262` id ` | [ ModuleCacheId] ( README.md#modulecacheid ) | 'abstract' unique id of the resource. This id is used as the key of the [[ Options.moduleCache]] |
263263` path ` | [ AbstractPath] ( README.md#abstractpath ) | file path of the resource |
264264
@@ -268,9 +268,9 @@ Name | Type | Description |
268268
269269• ` Const ` ** version** : string = process.env.VERSION
270270
271- * Defined in [ tools.ts:53] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/tools.ts#L53 ) *
271+ * Defined in [ tools.ts:53] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/tools.ts#L53 ) *
272272
273- * Defined in [ index.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/index.ts#L26 ) *
273+ * Defined in [ index.ts:26] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/index.ts#L26 ) *
274274
275275the version of the library (process.env.VERSION is set by webpack, at compile-time)
276276
@@ -280,15 +280,15 @@ ___
280280
281281• ` Const ` ** vueVersion** : string
282282
283- * Defined in [ createSFCModule.ts:4] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/createSFCModule.ts#L4 ) *
283+ * Defined in [ createSFCModule.ts:4] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/createSFCModule.ts#L4 ) *
284284
285285## Functions
286286
287287### buildTemplateProcessor
288288
289289▸ ** buildTemplateProcessor** (` processor ` : [ LangProcessor] ( README.md#langprocessor ) ): object
290290
291- * Defined in [ index.ts:179] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/index.ts#L179 ) *
291+ * Defined in [ index.ts:179] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/index.ts#L179 ) *
292292
293293Convert a function to template processor interface (consolidate)
294294
310310
311311▸ ** createSFCModule** (` source ` : string, ` filename ` : [ AbstractPath] ( README.md#abstractpath ) , ` options ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \>
312312
313- * Defined in [ createSFCModule.ts:3] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/createSFCModule.ts#L3 ) *
313+ * Defined in [ createSFCModule.ts:3] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/createSFCModule.ts#L3 ) *
314314
315315#### Parameters:
316316
328328
329329▸ ** defaultGetResource** (` pathCx ` : [ PathContext] ( README.md#pathcontext ) , ` options ` : [ Options] ( README.md#options ) ): [ Resource] ( README.md#resource )
330330
331- * Defined in [ index.ts:76] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/index.ts#L76 ) *
331+ * Defined in [ index.ts:76] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/index.ts#L76 ) *
332332
333333Default getResource implementation
334334by default, getContent() use the file extension as file type.
348348
349349▸ ** defaultHandleModule** (` type ` : string, ` getContentData ` : File[ \" getContentData\" ] , ` path ` : [ AbstractPath] ( README.md#abstractpath ) , ` options ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \| null\>
350350
351- * Defined in [ tools.ts:372] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/tools.ts#L372 ) *
351+ * Defined in [ tools.ts:372] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/tools.ts#L372 ) *
352352
353353Default implementation of handleModule
354354
369369
370370▸ ` Const ` ** defaultPathResolve** (` __namedParameters ` : { refPath: [ AbstractPath] ( README.md#abstractpath ) ; relPath: [ AbstractPath] ( README.md#abstractpath ) }): string \| [ AbstractPath] ( README.md#abstractpath )
371371
372- * Defined in [ index.ts:53] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/index.ts#L53 ) *
372+ * Defined in [ index.ts:53] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/index.ts#L53 ) *
373373
374374Default resolve implementation
375375resolve() should handle 3 situations :
391391
392392▸ ** loadModule** (` path ` : [ AbstractPath] ( README.md#abstractpath ) , ` options? ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \>
393393
394- * Defined in [ index.ts:152] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/index.ts#L152 ) *
394+ * Defined in [ index.ts:152] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/index.ts#L152 ) *
395395
396396This is the main function.
397397This function is intended to be used only to load the entry point of your application.
445445
446446▸ ** loadModuleInternal** (` pathCx ` : [ PathContext] ( README.md#pathcontext ) , ` options ` : [ Options] ( README.md#options ) ): Promise<[ ModuleExport] ( README.md#moduleexport ) \>
447447
448- * Defined in [ tools.ts:260] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/04817e0 /src/tools.ts#L260 ) *
448+ * Defined in [ tools.ts:260] ( https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1 /src/tools.ts#L260 ) *
449449
450450#### Parameters:
451451
0 commit comments