Skip to content

Commit 2a71c65

Browse files
author
Franck Freiburger
committed
chore(docs): v0.8.2 API docs & examples
1 parent 9111483 commit 2a71c65

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

docs/api/README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
Ƭ **AbstractPath**: { toString: () => string }
4747

48-
*Defined in [types.ts:32](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L32)*
48+
*Defined in [types.ts:32](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L32)*
4949

5050
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.
5151

@@ -61,7 +61,7 @@ ___
6161

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

64-
*Defined in [types.ts:20](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L20)*
64+
*Defined in [types.ts:20](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L20)*
6565

6666
#### Type declaration:
6767

@@ -76,15 +76,15 @@ ___
7676

7777
Ƭ **ContentData**: string \| ArrayBuffer
7878

79-
*Defined in [types.ts:71](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L71)*
79+
*Defined in [types.ts:71](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L71)*
8080

8181
___
8282

8383
### CustomBlock
8484

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

87-
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L109)*
87+
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L109)*
8888

8989
A custom block
9090

@@ -102,7 +102,7 @@ ___
102102

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

105-
*Defined in [types.ts:103](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L103)*
105+
*Defined in [types.ts:103](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L103)*
106106

107107
CustomBlockCallback function type
108108

@@ -112,7 +112,7 @@ ___
112112

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

115-
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L77)*
115+
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L77)*
116116

117117
Represents a file content and the extension name.
118118

@@ -129,15 +129,15 @@ ___
129129

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

132-
*Defined in [types.ts:399](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L399)*
132+
*Defined in [types.ts:399](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L399)*
133133

134134
___
135135

136136
### Module
137137

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

140-
*Defined in [types.ts:129](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L129)*
140+
*Defined in [types.ts:129](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L129)*
141141

142142
This just represents a loaded js module
143143

@@ -153,15 +153,15 @@ ___
153153

154154
Ƭ **ModuleCacheId**: string
155155

156-
*Defined in [types.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L26)*
156+
*Defined in [types.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L26)*
157157

158158
___
159159

160160
### ModuleExport
161161

162162
Ƭ **ModuleExport**: {}
163163

164-
*Defined in [types.ts:123](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L123)*
164+
*Defined in [types.ts:123](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L123)*
165165

166166
This just represents a loaded js module exports
167167

@@ -171,7 +171,7 @@ ___
171171

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

174-
*Defined in [types.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L68)*
174+
*Defined in [types.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L68)*
175175

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

@@ -196,7 +196,7 @@ ___
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/9dfc5b1/src/types.ts#L140)*
199+
*Defined in [types.ts:140](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L140)*
200200

201201
#### Type declaration:
202202

@@ -222,7 +222,7 @@ ___
222222

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

225-
*Defined in [types.ts:41](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L41)*
225+
*Defined in [types.ts:41](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L41)*
226226

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

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

243-
*Defined in [types.ts:50](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/types.ts#L50)*
243+
*Defined in [types.ts:50](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L50)*
244244

245245
relative to absolute module path resolution
246246

@@ -250,7 +250,7 @@ ___
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/9dfc5b1/src/types.ts#L88)*
253+
*Defined in [types.ts:88](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/types.ts#L88)*
254254

255255
Represents a resource.
256256

@@ -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/9dfc5b1/src/tools.ts#L53)*
271+
*Defined in [tools.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/tools.ts#L53)*
272272

273-
*Defined in [index.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9dfc5b1/src/index.ts#L26)*
273+
*Defined in [index.ts:26](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/index.ts#L26)*
274274

275275
the 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/9dfc5b1/src/createSFCModule.ts#L4)*
283+
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/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/9dfc5b1/src/index.ts#L179)*
291+
*Defined in [index.ts:179](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/index.ts#L179)*
292292

293293
Convert a function to template processor interface (consolidate)
294294

@@ -310,7 +310,7 @@ ___
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/9dfc5b1/src/createSFCModule.ts#L3)*
313+
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/createSFCModule.ts#L3)*
314314

315315
#### Parameters:
316316

@@ -328,7 +328,7 @@ ___
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/9dfc5b1/src/index.ts#L76)*
331+
*Defined in [index.ts:76](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/index.ts#L76)*
332332

333333
Default getResource implementation
334334
by default, getContent() use the file extension as file type.
@@ -348,7 +348,7 @@ ___
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/9dfc5b1/src/tools.ts#L372)*
351+
*Defined in [tools.ts:372](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/tools.ts#L372)*
352352

353353
Default implementation of handleModule
354354

@@ -369,7 +369,7 @@ ___
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/9dfc5b1/src/index.ts#L53)*
372+
*Defined in [index.ts:53](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/index.ts#L53)*
373373

374374
Default resolve implementation
375375
resolve() should handle 3 situations :
@@ -391,7 +391,7 @@ ___
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/9dfc5b1/src/index.ts#L152)*
394+
*Defined in [index.ts:152](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/index.ts#L152)*
395395

396396
This is the main function.
397397
This function is intended to be used only to load the entry point of your application.
@@ -445,7 +445,7 @@ ___
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/9dfc5b1/src/tools.ts#L260)*
448+
*Defined in [tools.ts:260](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/9111483/src/tools.ts#L260)*
449449

450450
#### Parameters:
451451

0 commit comments

Comments
 (0)