Skip to content

Commit d935905

Browse files
author
Franck Freiburger
committed
chore(docs): v0.9.1 API docs & examples
1 parent 0811db4 commit d935905

File tree

2 files changed

+68
-68
lines changed

2 files changed

+68
-68
lines changed

docs/api/README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
Ƭ **AbstractPath**: { toString: () => string }
5151

52-
*Defined in [types.ts:32](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L32)*
52+
*Defined in [types.ts:32](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L32)*
5353

5454
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.
5555

@@ -63,15 +63,15 @@ ___
6363

6464
### Cache
6565

66-
Ƭ **Cache**: { get: (key: string) => Promise<string\> ; set: (key: string, value: string) => Promise<void\> }
66+
Ƭ **Cache**: { get: (key: string) => Promise<string \| undefined\> ; set: (key: string, value: string) => Promise<void\> }
6767

68-
*Defined in [types.ts:20](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L20)*
68+
*Defined in [types.ts:20](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L20)*
6969

7070
#### Type declaration:
7171

7272
Name | Type |
7373
------ | ------ |
74-
`get` | (key: string) => Promise<string\> |
74+
`get` | (key: string) => Promise<string \| undefined\> |
7575
`set` | (key: string, value: string) => Promise<void\> |
7676

7777
___
@@ -80,15 +80,15 @@ ___
8080

8181
Ƭ **ContentData**: string \| ArrayBuffer
8282

83-
*Defined in [types.ts:71](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L71)*
83+
*Defined in [types.ts:71](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L71)*
8484

8585
___
8686

8787
### CustomBlock
8888

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

91-
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L109)*
91+
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L109)*
9292

9393
A custom block
9494

@@ -106,7 +106,7 @@ ___
106106

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

109-
*Defined in [types.ts:103](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L103)*
109+
*Defined in [types.ts:103](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L103)*
110110

111111
CustomBlockCallback function type
112112

@@ -116,7 +116,7 @@ ___
116116

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

119-
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L77)*
119+
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L77)*
120120

121121
Represents a file content and the extension name.
122122

@@ -133,15 +133,15 @@ ___
133133

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

136-
*Defined in [types.ts:422](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L422)*
136+
*Defined in [types.ts:422](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L422)*
137137

138138
___
139139

140140
### Module
141141

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

144-
*Defined in [types.ts:128](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L128)*
144+
*Defined in [types.ts:128](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L128)*
145145

146146
This just represents a loaded js module
147147

@@ -157,15 +157,15 @@ ___
157157

158158
Ƭ **ModuleCacheId**: string
159159

160-
*Defined in [types.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L26)*
160+
*Defined in [types.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L26)*
161161

162162
___
163163

164164
### ModuleExport
165165

166166
Ƭ **ModuleExport**: {} \| null
167167

168-
*Defined in [types.ts:123](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L123)*
168+
*Defined in [types.ts:123](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L123)*
169169

170170
This just represents a loaded js module exports
171171

@@ -175,7 +175,7 @@ ___
175175

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

178-
*Defined in [types.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L68)*
178+
*Defined in [types.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L68)*
179179

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

@@ -200,7 +200,7 @@ ___
200200

201201
Ƭ **Options**: { additionalBabelParserPlugins?: babel\_ParserPlugin[] ; additionalBabelPlugins?: Record<string, any\> ; compiledCache?: [Cache](README.md#cache) ; delimiters?: [string, string] ; devMode?: boolean ; handleModule?: [ModuleHandler](README.md#modulehandler) ; isCustomElement: (tag: string) => boolean \| undefined ; moduleCache: Record<[ModuleCacheId](README.md#modulecacheid), LoadingType<[ModuleExport](README.md#moduleexport)\> \| [ModuleExport](README.md#moduleexport)\> ; pathResolve: [PathResolve](README.md#pathresolve) ; whitespace?: \"preserve\" \| \"condense\" ; 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 }
202202

203-
*Defined in [types.ts:139](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L139)*
203+
*Defined in [types.ts:139](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L139)*
204204

205205
#### Type declaration:
206206

@@ -227,9 +227,9 @@ ___
227227

228228
### PathContext
229229

230-
Ƭ **PathContext**: { refPath: [AbstractPath](README.md#abstractpath) ; relPath: [AbstractPath](README.md#abstractpath) }
230+
Ƭ **PathContext**: { refPath: [AbstractPath](README.md#abstractpath) \| undefined ; relPath: [AbstractPath](README.md#abstractpath) }
231231

232-
*Defined in [types.ts:41](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L41)*
232+
*Defined in [types.ts:41](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L41)*
233233

234234
A PathContext represents a path (relPath) relative to an abolute path (refPath)
235235
Note that relPath is not necessary relative, but when it is, relPath is relative to refPath.
@@ -238,7 +238,7 @@ Note that relPath is not necessary relative, but when it is, relPath is relative
238238

239239
Name | Type | Description |
240240
------ | ------ | ------ |
241-
`refPath` | [AbstractPath](README.md#abstractpath) | reference path |
241+
`refPath` | [AbstractPath](README.md#abstractpath) \| undefined | reference path |
242242
`relPath` | [AbstractPath](README.md#abstractpath) | relative to @refPath |
243243

244244
___
@@ -247,7 +247,7 @@ ___
247247

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

250-
*Defined in [types.ts:50](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L50)*
250+
*Defined in [types.ts:50](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L50)*
251251

252252
relative to absolute module path resolution
253253

@@ -257,7 +257,7 @@ ___
257257

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

260-
*Defined in [types.ts:88](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/types.ts#L88)*
260+
*Defined in [types.ts:88](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/types.ts#L88)*
261261

262262
Represents a resource.
263263

@@ -275,9 +275,9 @@ Name | Type | Description |
275275

276276
`Const` **version**: string = process.env.VERSION as string
277277

278-
*Defined in [tools.ts:49](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/tools.ts#L49)*
278+
*Defined in [tools.ts:49](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/tools.ts#L49)*
279279

280-
*Defined in [index.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/index.ts#L26)*
280+
*Defined in [index.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/index.ts#L26)*
281281

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

@@ -287,15 +287,15 @@ ___
287287

288288
`Const` **vueVersion**: string
289289

290-
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/createSFCModule.ts#L4)*
290+
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/createSFCModule.ts#L4)*
291291

292292
## Functions
293293

294294
### buildTemplateProcessor
295295

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

298-
*Defined in [index.ts:184](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/index.ts#L184)*
298+
*Defined in [index.ts:187](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/index.ts#L187)*
299299

300300
Convert a function to template processor interface (consolidate)
301301

@@ -317,7 +317,7 @@ ___
317317

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

320-
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/createSFCModule.ts#L3)*
320+
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/createSFCModule.ts#L3)*
321321

322322
#### Parameters:
323323

@@ -335,7 +335,7 @@ ___
335335

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

338-
*Defined in [index.ts:76](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/index.ts#L76)*
338+
*Defined in [index.ts:76](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/index.ts#L76)*
339339

340340
Default getResource implementation
341341
by default, getContent() use the file extension as file type.
@@ -355,7 +355,7 @@ ___
355355

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

358-
*Defined in [tools.ts:388](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/tools.ts#L388)*
358+
*Defined in [tools.ts:399](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/tools.ts#L399)*
359359

360360
Default implementation of handleModule
361361

@@ -376,7 +376,7 @@ ___
376376

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

379-
*Defined in [index.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/index.ts#L53)*
379+
*Defined in [index.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/index.ts#L53)*
380380

381381
Default resolve implementation
382382
resolve() should handle 3 situations :
@@ -398,7 +398,7 @@ ___
398398

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

401-
*Defined in [index.ts:157](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/index.ts#L157)*
401+
*Defined in [index.ts:157](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/index.ts#L157)*
402402

403403
This is the main function.
404404
This function is intended to be used only to load the entry point of your application.
@@ -452,7 +452,7 @@ ___
452452

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

455-
*Defined in [tools.ts:276](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/tools.ts#L276)*
455+
*Defined in [tools.ts:276](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/tools.ts#L276)*
456456

457457
#### Parameters:
458458

@@ -469,6 +469,6 @@ Name | Type |
469469

470470
`Const` **targetBrowserBabelPlugins**: object
471471

472-
*Defined in [tools.ts:211](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/70777c8/src/tools.ts#L211)*
472+
*Defined in [tools.ts:211](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/0811db4/src/tools.ts#L211)*
473473

474474
#### Properties:

0 commit comments

Comments
 (0)