Skip to content

Commit e887e6c

Browse files
chore(docs) v0.2.19 API docs & examples
1 parent 547328e commit e887e6c

File tree

5 files changed

+86
-42
lines changed

5 files changed

+86
-42
lines changed

docs/api/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
Ƭ **File**: string \| { content: string ; extname: string }
3333

34-
*Defined in [index.ts:75](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L75)*
34+
*Defined in [index.ts:75](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L75)*
3535

3636
Represents the content of the file or the content and the extension name.
3737

@@ -41,17 +41,17 @@ Represents the content of the file or the content and the extension name.
4141

4242
`Const` **version**: string = process.env.VERSION
4343

44-
*Defined in [index.ts:278](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L278)*
44+
*Defined in [index.ts:278](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L278)*
4545

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

4848
## Functions
4949

5050
### loadModule
5151

52-
**loadModule**(`path`: string, `options?`: [Options](interfaces/options.md)): Promise\<[Module](interfaces/module.md)>
52+
**loadModule**(`path`: string, `options?`: [Options](interfaces/options.md)): Promise<[Module](interfaces/module.md)\>
5353

54-
*Defined in [index.ts:749](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L749)*
54+
*Defined in [index.ts:750](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L750)*
5555

5656
This is the main function.
5757

@@ -62,7 +62,7 @@ Name | Type | Default value | Description |
6262
`path` | string | - | The path of the `.vue` file. If path is not a path (eg. an string ID), your [getFile](interfaces/options.md#getfile) function must return a [File](README.md#file) object. |
6363
`options` | [Options](interfaces/options.md) | throwNotDefined('options') | The options |
6464

65-
**Returns:** Promise\<[Module](interfaces/module.md)>
65+
**Returns:** Promise<[Module](interfaces/module.md)\>
6666

6767
A Promise of the component
6868

docs/api/interfaces/cache.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@
1919

2020
### get
2121

22-
**get**(`key`: string): Promise\<string>
22+
**get**(`key`: string): Promise<string\>
2323

24-
*Defined in [index.ts:67](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L67)*
24+
*Defined in [index.ts:67](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L67)*
2525

2626
#### Parameters:
2727

2828
Name | Type |
2929
------ | ------ |
3030
`key` | string |
3131

32-
**Returns:** Promise\<string>
32+
**Returns:** Promise<string\>
3333

3434
___
3535

3636
### set
3737

38-
**set**(`key`: string, `value`: string): Promise\<void>
38+
**set**(`key`: string, `value`: string): Promise<void\>
3939

40-
*Defined in [index.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L68)*
40+
*Defined in [index.ts:68](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L68)*
4141

4242
#### Parameters:
4343

@@ -46,4 +46,4 @@ Name | Type |
4646
`key` | string |
4747
`value` | string |
4848

49-
**Returns:** Promise\<void>
49+
**Returns:** Promise<void\>

docs/api/interfaces/modulehandler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ see [additionalModuleHandlers](options.md#additionalmodulehandlers)
1313

1414
## Callable
1515

16-
▸ (`source`: string, `path`: string, `options`: [Options](options.md)): Promise\<[Module](module.md)>
16+
▸ (`source`: string, `path`: string, `options`: [Options](options.md)): Promise<[Module](module.md)\>
1717

18-
*Defined in [index.ts:261](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L261)*
18+
*Defined in [index.ts:261](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L261)*
1919

2020
Used by the library when it does not know how to handle a given file type (eg. `.json` files).
2121
see [additionalModuleHandlers](options.md#additionalmodulehandlers)
@@ -28,4 +28,4 @@ Name | Type | Description |
2828
`path` | string | The path of the file |
2929
`options` | [Options](options.md) | The options **example:** ```javascript ... additionalModuleHandlers: { '.json': (source, path, options) => JSON.parse(source), } ... ``` |
3030

31-
**Returns:** Promise\<[Module](module.md)>
31+
**Returns:** Promise<[Module](module.md)\>

docs/api/interfaces/options.md

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

3131
`Optional` **additionalBabelPlugins**: any[]
3232

33-
*Defined in [index.ts:146](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L146)*
33+
*Defined in [index.ts:146](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L146)*
3434

3535
Additional babel plugins. [TBD]
3636

@@ -43,9 +43,9 @@ ___
4343

4444
### additionalModuleHandlers
4545

46-
`Optional` **additionalModuleHandlers**: Record\<string, [ModuleHandler](modulehandler.md)>
46+
`Optional` **additionalModuleHandlers**: Record<string, [ModuleHandler](modulehandler.md)\>
4747

48-
*Defined in [index.ts:153](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L153)*
48+
*Defined in [index.ts:153](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L153)*
4949

5050
Additional module type handlers. see [ModuleHandler](modulehandler.md)
5151

@@ -55,7 +55,7 @@ ___
5555

5656
`Optional` **compiledCache**: [Cache](cache.md)
5757

58-
*Defined in [index.ts:193](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L193)*
58+
*Defined in [index.ts:193](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L193)*
5959

6060
[get](cache.md#get)() and [set](cache.md#set)() functions of this object are called when the lib needs to save or load already compiled code. get and set functions must return a `Promise` (or can be `async`).
6161
Since compilation consume a lot of CPU, is is always a good idea to provide this object.
@@ -97,9 +97,9 @@ ___
9797

9898
### moduleCache
9999

100-
`Optional` **moduleCache**: Record\<string, [Module](module.md)>
100+
`Optional` **moduleCache**: Record<string, [Module](module.md)\>
101101

102-
*Defined in [index.ts:95](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L95)*
102+
*Defined in [index.ts:95](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L95)*
103103

104104
Initial cache that will contain resolved dependencies. All new modules go here.
105105
`vue` must initially be contained in this object.
@@ -119,7 +119,7 @@ Initial cache that will contain resolved dependencies. All new modules go here.
119119

120120
**addStyle**(`style`: string, `scopeId`: string): void
121121

122-
*Defined in [index.ts:135](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L135)*
122+
*Defined in [index.ts:135](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L135)*
123123

124124
Called by the library when CSS style must be added in the HTML document.
125125

@@ -149,9 +149,9 @@ ___
149149

150150
### getFile
151151

152-
**getFile**(`path`: string): Promise\<[File](../README.md#file)>
152+
**getFile**(`path`: string): Promise<[File](../README.md#file)\>
153153

154-
*Defined in [index.ts:113](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L113)*
154+
*Defined in [index.ts:113](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L113)*
155155

156156
Called by the library when it needs a file.
157157

@@ -161,7 +161,7 @@ Name | Type | Description |
161161
------ | ------ | ------ |
162162
`path` | string | The path of the file |
163163

164-
**Returns:** Promise\<[File](../README.md#file)>
164+
**Returns:** Promise<[File](../README.md#file)\>
165165

166166
a Promise of the file content (UTF-8)
167167

@@ -179,9 +179,9 @@ ___
179179

180180
### loadModule
181181

182-
`Optional`**loadModule**(`path`: string, `options`: [Options](options.md)): Promise\<[Module](module.md)> \| undefined
182+
`Optional`**loadModule**(`path`: string, `options`: [Options](options.md)): Promise<[Module](module.md) \| undefined\>
183183

184-
*Defined in [index.ts:230](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L230)*
184+
*Defined in [index.ts:230](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L230)*
185185

186186
Called when the lib requires a module. Do return `undefined` to let the library handle this.
187187

@@ -192,7 +192,7 @@ Name | Type | Description |
192192
`path` | string | The path of the module. |
193193
`options` | [Options](options.md) | The options object. |
194194

195-
**Returns:** Promise\<[Module](module.md)> \| undefined
195+
**Returns:** Promise<[Module](module.md) \| undefined\>
196196

197197
A Promise of the module or undefined
198198

@@ -212,7 +212,7 @@ ___
212212

213213
`Optional`**log**(`type`: string, ...`data`: any[]): void
214214

215-
*Defined in [index.ts:211](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/72c1539/src/index.ts#L211)*
215+
*Defined in [index.ts:211](https://github.com/FranckFreiburger/vue3-sfc-loader/blob/547328e/src/index.ts#L211)*
216216

217217
Called by the library when there is somthing to log (eg. scripts compilation errors, template compilation errors, template compilation tips, style compilation errors, ...)
218218

0 commit comments

Comments
 (0)