Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema committed Nov 25, 2024
1 parent dbd368d commit 31ebde4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
32 changes: 16 additions & 16 deletions docs/src/content/docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ sidebar:

Create a new StyleDictionary instance.

| Param | Type | Description |
| ------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `config` | [`Config`](/reference/config) | Configuration options to build your style dictionary. If you pass a string, it will be used as a path to a JSON config file. You can also pass an object with the configuration. |
| `options` | `Object` | Options object when creating a new StyleDictionary instance. |
| `options.init` | `boolean` | `true` by default but can be disabled to delay initializing the dictionary. You can then call `sdInstance.init()` yourself, e.g. for testing or error handling purposes. |
| `options.verbosity` | `'silent'\|'default'\|'verbose'` | Verbosity of logs, overrides `log.verbosity` set in SD config or platform config. |
| `options.warnings` | `'error'\|'warn'\|'disabled'` | Whether to throw warnings as errors, warn or disable warnings, overrides `log.verbosity` set in SD config or platform config. |
| `options.volume` | `import('memfs').IFs \| typeof import('node:fs')` | FileSystem Volume to use as an alternative to the default FileSystem, handy if you need to isolate or "containerise" StyleDictionary files |
| Param | Type | Description |
| ------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `config` | [`Config`](/reference/config) | Configuration options to build your style dictionary. If you pass a string, it will be used as a path to a JSON or JavaScript ESM (default export) config file. TypeScript file is natively supported as well with Bun, Deno or NodeJS >= 22.6.0 + `--experimental-strip-types` flag. Alternatively, you can also pass an object with the configuration. |
| `options` | `Object` | Options object when creating a new StyleDictionary instance. |
| `options.init` | `boolean` | `true` by default but can be disabled to delay initializing the dictionary. You can then call `sdInstance.init()` yourself, e.g. for testing or error handling purposes. |
| `options.verbosity` | `'silent'\|'default'\|'verbose'` | Verbosity of logs, overrides `log.verbosity` set in SD config or platform config. |
| `options.warnings` | `'error'\|'warn'\|'disabled'` | Whether to throw warnings as errors, warn or disable warnings, overrides `log.verbosity` set in SD config or platform config. |
| `options.volume` | `import('memfs').IFs \| typeof import('node:fs')` | FileSystem Volume to use as an alternative to the default FileSystem, handy if you need to isolate or "containerise" StyleDictionary files |

Example:

Expand Down Expand Up @@ -114,14 +114,14 @@ type extend = (config: Config | string, options: Options) ⇒ Promise<SDInstance
Extend a Style Dictionary instance with a config object, to create an extension instance.
| Param | Type | Description |
| ------------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `config` | [`Config`](/reference/config) | Configuration options to build your style dictionary. If you pass a string, it will be used as a path to a JSON config file. You can also pass an object with the configuration. |
| `options` | `Object` | |
| `options.verbosity` | `'silent'\|'default'\|'verbose'` | Verbosity of logs, overrides `log.verbosity` set in SD config or platform config. |
| `options.warnings` | `'error'\|'warn'\|'disabled'` | Whether to throw warnings as errors, warn or disable warnings, overrides `log.verbosity` set in SD config or platform config. |
| `options.volume` | `import('memfs').IFs \| typeof import('node:fs')` | Pass a custom Volume to use instead of filesystem shim itself. Only possible in browser or in Node if you're explicitly using `memfs` as filesystem shim (by calling `setFs()` function and setting it to the `memfs` module) |
| `options.mutateOriginal` | `boolean` | Private option, do not use |
| Param | Type | Description |
| ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `config` | [`Config`](/reference/config) | Configuration options to build your style dictionary. If you pass a string, it will be used as a path to a JSON or JavaScript ESM (default export) config file. TypeScript file is natively supported as well with Bun, Deno or NodeJS >= 22.6.0 + `--experimental-strip-types` flag. Alternatively, can also pass an object with the configuration. |
| `options` | `Object` | |
| `options.verbosity` | `'silent'\|'default'\|'verbose'` | Verbosity of logs, overrides `log.verbosity` set in SD config or platform config. |
| `options.warnings` | `'error'\|'warn'\|'disabled'` | Whether to throw warnings as errors, warn or disable warnings, overrides `log.verbosity` set in SD config or platform config. |
| `options.volume` | `import('memfs').IFs \| typeof import('node:fs')` | Pass a custom Volume to use instead of filesystem shim itself. Only possible in browser or in Node if you're explicitly using `memfs` as filesystem shim (by calling `setFs()` function and setting it to the `memfs` module) |
| `options.mutateOriginal` | `boolean` | Private option, do not use |
Example:
Expand Down
Loading

0 comments on commit 31ebde4

Please sign in to comment.