Skip to content

Commit 1481e60

Browse files
author
Franck Freiburger
committed
chore(docs): v0.8.4 API docs & examples
1 parent 4211825 commit 1481e60

File tree

2 files changed

+74
-60
lines changed

2 files changed

+74
-60
lines changed

docs/api/README.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@
3939
* [loadModule](README.md#loadmodule)
4040
* [loadModuleInternal](README.md#loadmoduleinternal)
4141

42+
### Object literals
43+
44+
* [targetBrowserBabelPlugins](README.md#targetbrowserbabelplugins)
45+
4246
## Type aliases
4347

4448
### AbstractPath
4549

4650
Ƭ **AbstractPath**: { toString: () => string }
4751

48-
*Defined in [types.ts:32](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L32)*
52+
*Defined in [types.ts:32](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L32)*
4953

5054
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.
5155

@@ -61,7 +65,7 @@ ___
6165

6266
Ƭ **Cache**: { get: (key: string) => Promise<string\> ; set: (key: string, value: string) => Promise<void\> }
6367

64-
*Defined in [types.ts:20](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L20)*
68+
*Defined in [types.ts:20](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L20)*
6569

6670
#### Type declaration:
6771

@@ -76,15 +80,15 @@ ___
7680

7781
Ƭ **ContentData**: string \| ArrayBuffer
7882

79-
*Defined in [types.ts:71](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L71)*
83+
*Defined in [types.ts:71](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L71)*
8084

8185
___
8286

8387
### CustomBlock
8488

8589
Ƭ **CustomBlock**: { attrs: Record<string, string \| true\> ; content: string ; type: string }
8690

87-
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L109)*
91+
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L109)*
8892

8993
A custom block
9094

@@ -102,7 +106,7 @@ ___
102106

103107
Ƭ **CustomBlockCallback**: (component: [ModuleExport](README.md#moduleexport)) => void
104108

105-
*Defined in [types.ts:103](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L103)*
109+
*Defined in [types.ts:103](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L103)*
106110

107111
CustomBlockCallback function type
108112

@@ -112,7 +116,7 @@ ___
112116

113117
Ƭ **File**: { getContentData: (asBinary: Boolean) => Promise<[ContentData](README.md#contentdata)\> ; type: string }
114118

115-
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L77)*
119+
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L77)*
116120

117121
Represents a file content and the extension name.
118122

@@ -129,15 +133,15 @@ ___
129133

130134
Ƭ **LangProcessor**: (source: string, preprocessOptions?: any) => Promise<string\> \| string
131135

132-
*Defined in [types.ts:399](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L399)*
136+
*Defined in [types.ts:399](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L399)*
133137

134138
___
135139

136140
### Module
137141

138142
Ƭ **Module**: { exports: [ModuleExport](README.md#moduleexport) }
139143

140-
*Defined in [types.ts:129](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L129)*
144+
*Defined in [types.ts:129](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L129)*
141145

142146
This just represents a loaded js module
143147

@@ -153,15 +157,15 @@ ___
153157

154158
Ƭ **ModuleCacheId**: string
155159

156-
*Defined in [types.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L26)*
160+
*Defined in [types.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L26)*
157161

158162
___
159163

160164
### ModuleExport
161165

162166
Ƭ **ModuleExport**: {}
163167

164-
*Defined in [types.ts:123](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L123)*
168+
*Defined in [types.ts:123](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L123)*
165169

166170
This just represents a loaded js module exports
167171

@@ -171,7 +175,7 @@ ___
171175

172176
Ƭ **ModuleHandler**: (type: string, getContentData: File[\"getContentData\"], path: [AbstractPath](README.md#abstractpath), options: [Options](README.md#options)) => Promise<[ModuleExport](README.md#moduleexport) \| null\>
173177

174-
*Defined in [types.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L68)*
178+
*Defined in [types.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L68)*
175179

176180
Used by the library when it needs to handle a does not know how to handle a given file type (eg. `.json` files).
177181

@@ -196,7 +200,7 @@ ___
196200

197201
Ƭ **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 }
198202

199-
*Defined in [types.ts:140](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L140)*
203+
*Defined in [types.ts:140](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L140)*
200204

201205
#### Type declaration:
202206

@@ -222,7 +226,7 @@ ___
222226

223227
Ƭ **PathContext**: { refPath: [AbstractPath](README.md#abstractpath) ; relPath: [AbstractPath](README.md#abstractpath) }
224228

225-
*Defined in [types.ts:41](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L41)*
229+
*Defined in [types.ts:41](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L41)*
226230

227231
A PathContext represents a path (relPath) relative to an abolute path (refPath)
228232
Note that relPath is not necessary relative, but it is, relPath is relative to refPath.
@@ -240,7 +244,7 @@ ___
240244

241245
Ƭ **PathResolve**: (pathCx: [PathContext](README.md#pathcontext)) => [AbstractPath](README.md#abstractpath)
242246

243-
*Defined in [types.ts:50](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L50)*
247+
*Defined in [types.ts:50](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L50)*
244248

245249
relative to absolute module path resolution
246250

@@ -250,7 +254,7 @@ ___
250254

251255
Ƭ **Resource**: { getContent: () => Promise<[File](README.md#file)\> ; id: [ModuleCacheId](README.md#modulecacheid) ; path: [AbstractPath](README.md#abstractpath) }
252256

253-
*Defined in [types.ts:88](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/types.ts#L88)*
257+
*Defined in [types.ts:88](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/types.ts#L88)*
254258

255259
Represents a resource.
256260

@@ -268,9 +272,9 @@ Name | Type | Description |
268272

269273
`Const` **version**: string = process.env.VERSION
270274

271-
*Defined in [tools.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/tools.ts#L53)*
275+
*Defined in [tools.ts:47](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/tools.ts#L47)*
272276

273-
*Defined in [index.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/index.ts#L26)*
277+
*Defined in [index.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/index.ts#L26)*
274278

275279
the version of the library (process.env.VERSION is set by webpack, at compile-time)
276280

@@ -280,15 +284,15 @@ ___
280284

281285
`Const` **vueVersion**: string
282286

283-
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/createSFCModule.ts#L4)*
287+
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/createSFCModule.ts#L4)*
284288

285289
## Functions
286290

287291
### buildTemplateProcessor
288292

289293
**buildTemplateProcessor**(`processor`: [LangProcessor](README.md#langprocessor)): object
290294

291-
*Defined in [index.ts:179](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/index.ts#L179)*
295+
*Defined in [index.ts:179](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/index.ts#L179)*
292296

293297
Convert a function to template processor interface (consolidate)
294298

@@ -310,7 +314,7 @@ ___
310314

311315
**createSFCModule**(`source`: string, `filename`: [AbstractPath](README.md#abstractpath), `options`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport)\>
312316

313-
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/createSFCModule.ts#L3)*
317+
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/createSFCModule.ts#L3)*
314318

315319
#### Parameters:
316320

@@ -328,7 +332,7 @@ ___
328332

329333
**defaultGetResource**(`pathCx`: [PathContext](README.md#pathcontext), `options`: [Options](README.md#options)): [Resource](README.md#resource)
330334

331-
*Defined in [index.ts:76](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/index.ts#L76)*
335+
*Defined in [index.ts:76](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/index.ts#L76)*
332336

333337
Default getResource implementation
334338
by default, getContent() use the file extension as file type.
@@ -348,7 +352,7 @@ ___
348352

349353
**defaultHandleModule**(`type`: string, `getContentData`: File[\"getContentData\"], `path`: [AbstractPath](README.md#abstractpath), `options`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport) \| null\>
350354

351-
*Defined in [tools.ts:372](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/tools.ts#L372)*
355+
*Defined in [tools.ts:370](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/tools.ts#L370)*
352356

353357
Default implementation of handleModule
354358

@@ -369,7 +373,7 @@ ___
369373

370374
`Const`**defaultPathResolve**(`__namedParameters`: { refPath: [AbstractPath](README.md#abstractpath) ; relPath: [AbstractPath](README.md#abstractpath) }): string \| [AbstractPath](README.md#abstractpath)
371375

372-
*Defined in [index.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/index.ts#L53)*
376+
*Defined in [index.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/index.ts#L53)*
373377

374378
Default resolve implementation
375379
resolve() should handle 3 situations :
@@ -391,7 +395,7 @@ ___
391395

392396
**loadModule**(`path`: [AbstractPath](README.md#abstractpath), `options?`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport)\>
393397

394-
*Defined in [index.ts:152](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/index.ts#L152)*
398+
*Defined in [index.ts:152](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/index.ts#L152)*
395399

396400
This is the main function.
397401
This function is intended to be used only to load the entry point of your application.
@@ -445,7 +449,7 @@ ___
445449

446450
**loadModuleInternal**(`pathCx`: [PathContext](README.md#pathcontext), `options`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport)\>
447451

448-
*Defined in [tools.ts:260](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/839a54b/src/tools.ts#L260)*
452+
*Defined in [tools.ts:258](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/tools.ts#L258)*
449453

450454
#### Parameters:
451455

@@ -455,3 +459,13 @@ Name | Type |
455459
`options` | [Options](README.md#options) |
456460

457461
**Returns:** Promise<[ModuleExport](README.md#moduleexport)\>
462+
463+
## Object literals
464+
465+
### targetBrowserBabelPlugins
466+
467+
`Const` **targetBrowserBabelPlugins**: object
468+
469+
*Defined in [tools.ts:205](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/4211825/src/tools.ts#L205)*
470+
471+
#### Properties:

0 commit comments

Comments
 (0)