Skip to content

Commit 5db3778

Browse files
chore(docs): v0.6.1 API docs & examples
1 parent 2f56d33 commit 5db3778

File tree

2 files changed

+152
-49
lines changed

2 files changed

+152
-49
lines changed

docs/api/README.md

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

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

48-
*Defined in [types.ts:15](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L15)*
48+
*Defined in [types.ts:15](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L15)*
4949

5050
#### Type declaration:
5151

@@ -60,7 +60,7 @@ ___
6060

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

63-
*Defined in [types.ts:95](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L95)*
63+
*Defined in [types.ts:95](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L95)*
6464

6565
A custom block
6666

@@ -78,7 +78,7 @@ ___
7878

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

81-
*Defined in [types.ts:89](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L89)*
81+
*Defined in [types.ts:89](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L89)*
8282

8383
CustomBlockCallback function type
8484

@@ -88,7 +88,7 @@ ___
8888

8989
Ƭ **File**: { content: string \| ArrayBuffer ; extname: string }
9090

91-
*Defined in [types.ts:66](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L66)*
91+
*Defined in [types.ts:66](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L66)*
9292

9393
Represents a file content and the extension name.
9494

@@ -105,15 +105,15 @@ ___
105105

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

108-
*Defined in [types.ts:368](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L368)*
108+
*Defined in [types.ts:368](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L368)*
109109

110110
___
111111

112112
### Module
113113

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

116-
*Defined in [types.ts:115](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L115)*
116+
*Defined in [types.ts:115](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L115)*
117117

118118
This just represents a loaded js module
119119

@@ -129,7 +129,7 @@ ___
129129

130130
Ƭ **ModuleExport**: {}
131131

132-
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L109)*
132+
*Defined in [types.ts:109](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L109)*
133133

134134
This just represents a loaded js module exports
135135

@@ -139,7 +139,7 @@ ___
139139

140140
Ƭ **ModuleHandler**: (extname: string, source: string, path: string, options: [Options](README.md#options)) => Promise<[ModuleExport](README.md#moduleexport) \| null\>
141141

142-
*Defined in [types.ts:60](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L60)*
142+
*Defined in [types.ts:60](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L60)*
143143

144144
Used by the library when it does not know how to handle a given file type (eg. `.json` files).
145145
see [[moduleHandlers]]
@@ -166,7 +166,7 @@ ___
166166

167167
Ƭ **Options**: { additionalBabelPlugins?: any[] ; compiledCache?: [Cache](README.md#cache) ; delimiters?: [string, string] ; handleModule?: [ModuleHandler](README.md#modulehandler) ; moduleCache?: Record<string, LoadingType<[ModuleExport](README.md#moduleexport)\> \| [ModuleExport](README.md#moduleexport)\> ; pathHandlers: [PathHandlers](README.md#pathhandlers) ; addStyle: (style: string, scopeId: string \| undefined) => void ; customBlockHandler?: (block: [CustomBlock](README.md#customblock), filename: string, options: [Options](README.md#options)) => Promise<[CustomBlockCallback](README.md#customblockcallback) \| undefined\> ; getFile: (path: string) => Promise<[File](README.md#file)\> ; getResource: (pathCx: [PathContext](README.md#pathcontext), options: [Options](README.md#options)) => [Resource](README.md#resource) ; loadModule?: (path: string, options: [Options](README.md#options)) => Promise<[ModuleExport](README.md#moduleexport) \| undefined\> ; log?: (type: string, ...data: any[]) => void }
168168

169-
*Defined in [types.ts:126](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L126)*
169+
*Defined in [types.ts:126](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L126)*
170170

171171
#### Type declaration:
172172

@@ -191,7 +191,7 @@ ___
191191

192192
Ƭ **PathContext**: { refPath: string ; relPath: string }
193193

194-
*Defined in [types.ts:25](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L25)*
194+
*Defined in [types.ts:25](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L25)*
195195

196196
A PathContext represents a path (relPath) relative to an abolute path (refPath)
197197
Note that relPath is not necessary relative, but it is, relPath is relative to refPath.
@@ -209,7 +209,7 @@ ___
209209

210210
Ƭ **PathHandlers**: { extname: (filepath: string) => string ; resolve: (pathCx: [PathContext](README.md#pathcontext)) => string }
211211

212-
*Defined in [types.ts:33](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L33)*
212+
*Defined in [types.ts:33](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L33)*
213213

214214
#### Type declaration:
215215

@@ -224,7 +224,7 @@ ___
224224

225225
Ƭ **Resource**: { getContent: () => Promise<[File](README.md#file)\> ; id: string ; path: string }
226226

227-
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/types.ts#L77)*
227+
*Defined in [types.ts:77](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/types.ts#L77)*
228228

229229
Represents a resource.
230230

@@ -242,9 +242,9 @@ Name | Type | Description |
242242

243243
`Const` **version**: string = process.env.VERSION
244244

245-
*Defined in [tools.ts:45](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/tools.ts#L45)*
245+
*Defined in [tools.ts:45](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/tools.ts#L45)*
246246

247-
*Defined in [index.ts:22](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/index.ts#L22)*
247+
*Defined in [index.ts:22](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/index.ts#L22)*
248248

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

@@ -254,15 +254,15 @@ ___
254254

255255
`Const` **vueVersion**: string
256256

257-
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/createSFCModule.ts#L4)*
257+
*Defined in [createSFCModule.ts:4](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/createSFCModule.ts#L4)*
258258

259259
## Functions
260260

261261
### buildTemplateProcessor
262262

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

265-
*Defined in [index.ts:144](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/index.ts#L144)*
265+
*Defined in [index.ts:147](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/index.ts#L147)*
266266

267267
Convert a function to template processor interface (consolidate)
268268

@@ -284,7 +284,7 @@ ___
284284

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

287-
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/createSFCModule.ts#L3)*
287+
*Defined in [createSFCModule.ts:3](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/createSFCModule.ts#L3)*
288288

289289
#### Parameters:
290290

@@ -302,7 +302,7 @@ ___
302302

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

305-
*Defined in [index.ts:59](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/index.ts#L59)*
305+
*Defined in [index.ts:59](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/index.ts#L59)*
306306

307307
#### Parameters:
308308

@@ -319,7 +319,7 @@ ___
319319

320320
**defaultHandleModule**(`extname`: string, `source`: string, `path`: string, `options`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport) \| null\>
321321

322-
*Defined in [tools.ts:360](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/tools.ts#L360)*
322+
*Defined in [tools.ts:360](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/tools.ts#L360)*
323323

324324
Default implementation of handleModule
325325

@@ -338,9 +338,9 @@ ___
338338

339339
### loadModule
340340

341-
**loadModule**(`path`: string, `options_?`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport)\>
341+
**loadModule**(`path`: string, `options?`: [Options](README.md#options)): Promise<[ModuleExport](README.md#moduleexport)\>
342342

343-
*Defined in [index.ts:112](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/index.ts#L112)*
343+
*Defined in [index.ts:112](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/index.ts#L112)*
344344

345345
This is the main function.
346346
This function is intended to be used only to load the entry point of your application.
@@ -351,7 +351,7 @@ If for some reason you need to use it in your components, be sure to share at le
351351
Name | Type | Default value | Description |
352352
------ | ------ | ------ | ------ |
353353
`path` | string | - | The path of the `.vue` file. If path is not a path (eg. an string ID), your [getFile](README.md#getfile) function must return a [File](README.md#file) object. |
354-
`options_` | [Options](README.md#options) | throwNotDefined('options') | - |
354+
`options` | [Options](README.md#options) | throwNotDefined('options') | The options |
355355

356356
**Returns:** Promise<[ModuleExport](README.md#moduleexport)\>
357357

@@ -394,7 +394,7 @@ ___
394394

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

397-
*Defined in [tools.ts:245](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/tools.ts#L245)*
397+
*Defined in [tools.ts:245](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/tools.ts#L245)*
398398

399399
#### Parameters:
400400

@@ -411,7 +411,7 @@ Name | Type |
411411

412412
`Const` **defaultPathHandlers**: object
413413

414-
*Defined in [index.ts:44](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/be82822/src/index.ts#L44)*
414+
*Defined in [index.ts:44](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/2f56d33/src/index.ts#L44)*
415415

416416
Default implementation of PathHandlers
417417

0 commit comments

Comments
 (0)