Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit dbb8758

Browse files
docs(readme): added types in readme (#89)
1 parent e718912 commit dbb8758

File tree

1 file changed

+59
-13
lines changed

1 file changed

+59
-13
lines changed

README.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ The target module is called with two arguments: `(options, loaderContext)`
3131
To begin, you'll need to install `val-loader`:
3232

3333
```console
34-
$ npm install val-loader --save-dev
34+
npm install val-loader --save-dev
35+
```
36+
37+
```console
38+
yarn add -D val-loader
39+
```
40+
41+
```console
42+
pnpm add -D val-loader
3543
```
3644

3745
Then add the loader to your `webpack` config. For example:
@@ -73,13 +81,16 @@ And run `webpack` via your preferred method.
7381

7482
## Options
7583

76-
| Name | Type | Default | Description |
77-
| :-------------------------------------: | :--------: | :---------: | :-------------------------------------------- |
78-
| **[`executableFile`](#executableFile)** | `{String}` | `undefined` | Allows to specify path to the executable file |
84+
- **[`executableFile`](#executableFile)**
7985

80-
### executableFile
86+
### `executableFile`
87+
88+
Type:
89+
90+
```ts
91+
type executableFile = string;
92+
```
8193

82-
Type: `String`
8394
Default: `undefined`
8495

8596
Allows to specify path to the executable file
@@ -144,22 +155,37 @@ contain any number of additional properties.
144155

145156
### `code`
146157

147-
Type: `String|Buffer`
158+
Type:
159+
160+
```ts
161+
type code = string | Buffer;
162+
```
163+
148164
Default: `undefined`
149165
_Required_
150166

151167
Code passed along to webpack or the next loader that will replace the module.
152168

153169
### `sourceMap`
154170

155-
Type: `Object`
171+
Type:
172+
173+
```ts
174+
type sourceMap = object;
175+
```
176+
156177
Default: `undefined`
157178

158179
A source map passed along to webpack or the next loader.
159180

160181
### `ast`
161182

162-
Type: `Array[Object]`
183+
Type:
184+
185+
```ts
186+
type ast = Array<object>;
187+
```
188+
163189
Default: `undefined`
164190

165191
An [Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
@@ -168,7 +194,12 @@ next loader uses the same AST.
168194

169195
### `dependencies`
170196

171-
Type: `Array[String]`
197+
Type:
198+
199+
```ts
200+
type dependencies = Array<string>;
201+
```
202+
172203
Default: `[]`
173204

174205
An array of absolute, native paths to file dependencies that should be watched by webpack for changes.
@@ -177,7 +208,12 @@ Dependencies can also be added using [`loaderContext.addDependency(file: string)
177208

178209
### `contextDependencies`
179210

180-
Type: `Array[String]`
211+
Type:
212+
213+
```ts
214+
type contextDependencies = Array<string>;
215+
```
216+
181217
Default: `[]`
182218

183219
An array of absolute, native paths to directory dependencies that should be watched by webpack for changes.
@@ -186,7 +222,12 @@ Context dependencies can also be added using [`loaderContext.addContextDependenc
186222

187223
### `buildDependencies`
188224

189-
Type: `Array[String]`
225+
Type:
226+
227+
```ts
228+
type buildDependencies = Array<string>;
229+
```
230+
190231
Default: `[]`
191232

192233
An array of absolute, native paths to directory dependencies that should be watched by webpack for changes.
@@ -195,7 +236,12 @@ Build dependencies can also be added using `loaderContext.addBuildDependency(fil
195236

196237
### `cacheable`
197238

198-
Type: `Boolean`
239+
Type:
240+
241+
```ts
242+
type cacheable = boolean;
243+
```
244+
199245
Default: `false`
200246

201247
If `true`, specifies that the code can be re-used in watch mode if none of the

0 commit comments

Comments
 (0)