sveld 0.35.2 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -6
- package/lib/browser.d.ts +660 -39
- package/lib/browser.js +172 -172
- package/lib/chunk-0fqdg2xa.js +20 -0
- package/lib/chunk-2vwf7nck.js +1 -0
- package/lib/chunk-8myyzjb1.js +4 -0
- package/lib/{chunk-v4q9vw0y.js → chunk-as5hgj7e.js} +57 -57
- package/lib/{chunk-zva3xjwa.js → chunk-denfbw92.js} +1 -1
- package/lib/chunk-h1r040pg.js +6 -0
- package/lib/chunk-m538qnhp.js +230 -0
- package/lib/chunk-r4rrncmd.js +1 -0
- package/lib/{chunk-1p4ka68s.js → chunk-t9d5k3p7.js} +1 -1
- package/lib/{chunk-8xw75w8t.js → chunk-tmj7vnjr.js} +2 -2
- package/lib/chunk-xryt7ad2.js +3 -0
- package/lib/cli-entry.js +1 -1
- package/lib/index.d.ts +767 -10
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/ComponentParser.d.ts +0 -560
- package/lib/ast-guards.d.ts +0 -16
- package/lib/brands.d.ts +0 -11
- package/lib/bundle.d.ts +0 -174
- package/lib/check.d.ts +0 -43
- package/lib/chunk-72hx9e9w.js +0 -20
- package/lib/chunk-7qz0hzgw.js +0 -217
- package/lib/chunk-cxrw7gzr.js +0 -2
- package/lib/chunk-jdnsv86e.js +0 -1
- package/lib/chunk-pmj8c3yv.js +0 -6
- package/lib/chunk-s9mzxa4y.js +0 -1
- package/lib/chunk-xkrgedm4.js +0 -4
- package/lib/cli-entry.d.ts +0 -12
- package/lib/cli.d.ts +0 -28
- package/lib/create-exports.d.ts +0 -32
- package/lib/dependency-graph.d.ts +0 -20
- package/lib/diagnostics.d.ts +0 -34
- package/lib/element-tag-map.d.ts +0 -146
- package/lib/example-check.d.ts +0 -24
- package/lib/get-svelte-entry.d.ts +0 -3
- package/lib/load-config.d.ts +0 -62
- package/lib/parse-cache.d.ts +0 -28
- package/lib/parse-entry-exports.d.ts +0 -30
- package/lib/parse-exports.d.ts +0 -25
- package/lib/parsed-component-metadata.d.ts +0 -13
- package/lib/parser/bindings.d.ts +0 -4
- package/lib/parser/context.d.ts +0 -72
- package/lib/parser/contexts.d.ts +0 -19
- package/lib/parser/diagnostics.d.ts +0 -8
- package/lib/parser/events.d.ts +0 -21
- package/lib/parser/generics.d.ts +0 -24
- package/lib/parser/jsdoc.d.ts +0 -55
- package/lib/parser/prop-shared.d.ts +0 -84
- package/lib/parser/props.d.ts +0 -71
- package/lib/parser/rest-props.d.ts +0 -4
- package/lib/parser/runes-detection.d.ts +0 -13
- package/lib/parser/runes-props.d.ts +0 -18
- package/lib/parser/scopes.d.ts +0 -56
- package/lib/parser/slots.d.ts +0 -24
- package/lib/parser/source-position.d.ts +0 -26
- package/lib/parser/type-resolution.d.ts +0 -17
- package/lib/parser/typescript-casts.d.ts +0 -1
- package/lib/parser/utils.d.ts +0 -1
- package/lib/parser/variable-jsdoc.d.ts +0 -12
- package/lib/parser-stack.d.ts +0 -20
- package/lib/path.d.ts +0 -2
- package/lib/plugin.d.ts +0 -85
- package/lib/resolve-alias.d.ts +0 -30
- package/lib/resolve-types.d.ts +0 -52
- package/lib/sveld.d.ts +0 -29
- package/lib/svelte-parse.d.ts +0 -4
- package/lib/svelte-version.d.ts +0 -1
- package/lib/validate.d.ts +0 -13
- package/lib/watch.d.ts +0 -34
- package/lib/writer/MarkdownWriterBase.d.ts +0 -26
- package/lib/writer/Writer.d.ts +0 -31
- package/lib/writer/WriterMarkdown.d.ts +0 -31
- package/lib/writer/built-in-writers.d.ts +0 -1
- package/lib/writer/document-model.d.ts +0 -34
- package/lib/writer/format-generated-ts.d.ts +0 -8
- package/lib/writer/markdown-format-utils.d.ts +0 -20
- package/lib/writer/markdown-render-utils.d.ts +0 -10
- package/lib/writer/registry.d.ts +0 -17
- package/lib/writer/writer-custom-elements-core.d.ts +0 -86
- package/lib/writer/writer-custom-elements.d.ts +0 -15
- package/lib/writer/writer-json.d.ts +0 -27
- package/lib/writer/writer-markdown-core.d.ts +0 -32
- package/lib/writer/writer-markdown.d.ts +0 -23
- package/lib/writer/writer-ts-definitions-core.d.ts +0 -30
- package/lib/writer/writer-ts-definitions.d.ts +0 -43
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { EntryExports } from "../parse-entry-exports";
|
|
2
|
-
import type { ComponentDocApi, ComponentDocs } from "../plugin";
|
|
3
|
-
export declare const COMPONENT_API_SCHEMA_VERSION = 1;
|
|
4
|
-
/**
|
|
5
|
-
* Canonical, renderer-agnostic representation of a component collection.
|
|
6
|
-
*
|
|
7
|
-
* Every writer (JSON, Markdown, TypeScript definitions) builds this document
|
|
8
|
-
* via `buildComponentApiDocument` instead of independently sorting/filtering
|
|
9
|
-
* the raw `ComponentDocs` map, so sort order and field stripping can't drift
|
|
10
|
-
* between output formats.
|
|
11
|
-
*/
|
|
12
|
-
export interface ComponentApiDocument {
|
|
13
|
-
schemaVersion: 1;
|
|
14
|
-
generator: {
|
|
15
|
-
name: string;
|
|
16
|
-
version: string;
|
|
17
|
-
svelteVersion: string;
|
|
18
|
-
};
|
|
19
|
-
total: number;
|
|
20
|
-
components: ComponentDocApi[];
|
|
21
|
-
/** Only when `documentExports` is on. */
|
|
22
|
-
totalExports?: number;
|
|
23
|
-
exports?: EntryExports;
|
|
24
|
-
}
|
|
25
|
-
export interface BuildComponentApiDocumentOptions {
|
|
26
|
-
/** Entry-barrel exports when `documentExports` is on. */
|
|
27
|
-
entryExports?: EntryExports;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Builds the canonical document for a component collection: components
|
|
31
|
-
* sorted alphabetically by `moduleName`, with the Node-only `diagnostics`
|
|
32
|
-
* field stripped.
|
|
33
|
-
*/
|
|
34
|
-
export declare function buildComponentApiDocument(components: ComponentDocs, options?: BuildComponentApiDocumentOptions): ComponentApiDocument;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reformats generator-emitted `.d.ts` source for consistent indentation and
|
|
3
|
-
* spacing, without depending on an external formatter. This is a structural
|
|
4
|
-
* cleanup pass (bracket-depth reindentation, blank-line normalization) rather
|
|
5
|
-
* than a full TypeScript printer — it does not wrap long lines or rewrite
|
|
6
|
-
* operator spacing.
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatGeneratedTypeScript(raw: string): string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { DeprecatedValue } from "../ComponentParser";
|
|
2
|
-
export declare const BACKTICK_REGEX: RegExp;
|
|
3
|
-
export declare const WHITESPACE_REGEX: RegExp;
|
|
4
|
-
export declare const MD_TYPE_UNDEFINED = "--";
|
|
5
|
-
export declare const PROP_TABLE_HEADER = "| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |\n| :- | :- | :- | :- | :- | :- | :- | :- |\n";
|
|
6
|
-
export declare const SLOT_TABLE_HEADER = "| Slot name | Default | Props | Fallback | Description |\n| :- | :- | :- | :- | :- |\n";
|
|
7
|
-
export declare const EVENT_TABLE_HEADER = "| Event name | Type | Detail | Description |\n| :- | :- | :- | :- |\n";
|
|
8
|
-
export declare const EXPORT_TABLE_HEADER = "| Name | Kind | Type | Description |\n| :- | :- | :- | :- |\n";
|
|
9
|
-
export declare function formatPropType(type?: string): string;
|
|
10
|
-
export declare function escapeHtml(text: string): string;
|
|
11
|
-
export declare function formatPropValue(value: string | undefined): string;
|
|
12
|
-
export declare function formatNameWithDeprecation(name: string, deprecated: DeprecatedValue | undefined): string;
|
|
13
|
-
export declare function formatPropDescription(description: string | undefined): string;
|
|
14
|
-
export declare function formatSlotProps(props?: string): string;
|
|
15
|
-
export declare function formatSlotFallback(fallback?: string): string;
|
|
16
|
-
export declare function formatSlotDescription(description?: string, tags?: Array<{
|
|
17
|
-
name: string;
|
|
18
|
-
body: string;
|
|
19
|
-
}>): string;
|
|
20
|
-
export declare function formatEventDetail(detail?: string): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EntryExports } from "../parse-entry-exports";
|
|
2
|
-
import type { ComponentDocs } from "../plugin";
|
|
3
|
-
import type { AppendType } from "./MarkdownWriterBase";
|
|
4
|
-
/** Minimal markdown writer surface used by JSON and browser renderers. */
|
|
5
|
-
interface MarkdownDocument {
|
|
6
|
-
append(type: AppendType, raw?: string): MarkdownDocument;
|
|
7
|
-
tableOfContents(): MarkdownDocument;
|
|
8
|
-
}
|
|
9
|
-
export declare function renderComponentsToMarkdown(document: MarkdownDocument, components: ComponentDocs, entryExports?: EntryExports): void;
|
|
10
|
-
export {};
|
package/lib/writer/registry.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ComponentDocs } from "../plugin";
|
|
2
|
-
/** Which component set a writer expects: exported-only, or every discovered component. */
|
|
3
|
-
export type WriterComponentSet = "exported" | "all";
|
|
4
|
-
/**
|
|
5
|
-
* A pluggable output format. Built-in writers (`json`, `markdown`, `types`)
|
|
6
|
-
* register themselves under these names; third parties can `registerWriter`
|
|
7
|
-
* their own to add new output formats without a core PR.
|
|
8
|
-
*/
|
|
9
|
-
export interface OutputWriter<TOptions = unknown> {
|
|
10
|
-
name: string;
|
|
11
|
-
/** Which component set this writer expects. @default "exported" */
|
|
12
|
-
componentSet?: WriterComponentSet;
|
|
13
|
-
write(components: ComponentDocs, options: TOptions): Promise<unknown> | unknown;
|
|
14
|
-
}
|
|
15
|
-
export declare function registerWriter<TOptions = unknown>(writer: OutputWriter<TOptions>): void;
|
|
16
|
-
export declare function getWriter(name: string): OutputWriter<unknown> | undefined;
|
|
17
|
-
export declare function listWriters(): OutputWriter<unknown>[];
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { DeprecatedValue } from "../ComponentParser";
|
|
2
|
-
import type { ComponentDocApi, ComponentDocs } from "../plugin";
|
|
3
|
-
/**
|
|
4
|
-
* Minimal local subset of the published Custom Elements Manifest schema
|
|
5
|
-
* (schemaVersion "1.0.0") for the fields sveld can populate. See
|
|
6
|
-
* https://github.com/webcomponents/custom-elements-manifest for the full spec.
|
|
7
|
-
*/
|
|
8
|
-
export interface CemType {
|
|
9
|
-
text: string;
|
|
10
|
-
}
|
|
11
|
-
export interface CemClassField {
|
|
12
|
-
kind: "field";
|
|
13
|
-
name: string;
|
|
14
|
-
type?: CemType;
|
|
15
|
-
default?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
deprecated?: DeprecatedValue;
|
|
18
|
-
}
|
|
19
|
-
export interface CemAttribute {
|
|
20
|
-
name: string;
|
|
21
|
-
fieldName: string;
|
|
22
|
-
type?: CemType;
|
|
23
|
-
default?: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface CemEvent {
|
|
27
|
-
name: string;
|
|
28
|
-
type: CemType;
|
|
29
|
-
description?: string;
|
|
30
|
-
deprecated?: DeprecatedValue;
|
|
31
|
-
}
|
|
32
|
-
export interface CemSlot {
|
|
33
|
-
name: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
deprecated?: DeprecatedValue;
|
|
36
|
-
}
|
|
37
|
-
export interface CemClassDeclaration {
|
|
38
|
-
kind: "class";
|
|
39
|
-
name: string;
|
|
40
|
-
description?: string;
|
|
41
|
-
members: CemClassField[];
|
|
42
|
-
attributes: CemAttribute[];
|
|
43
|
-
events: CemEvent[];
|
|
44
|
-
slots: CemSlot[];
|
|
45
|
-
/** Only present when the source component sets `<svelte:options customElement="..." />`. */
|
|
46
|
-
tagName?: string;
|
|
47
|
-
/** Only present when the source component sets `<svelte:options customElement="..." />`. */
|
|
48
|
-
customElement?: true;
|
|
49
|
-
}
|
|
50
|
-
export interface CemJavaScriptExport {
|
|
51
|
-
kind: "js";
|
|
52
|
-
name: string;
|
|
53
|
-
declaration: {
|
|
54
|
-
name: string;
|
|
55
|
-
module: string;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export interface CemCustomElementExport {
|
|
59
|
-
kind: "custom-element-definition";
|
|
60
|
-
name: string;
|
|
61
|
-
declaration: {
|
|
62
|
-
name: string;
|
|
63
|
-
module: string;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export type CemExport = CemJavaScriptExport | CemCustomElementExport;
|
|
67
|
-
export interface CemModule {
|
|
68
|
-
kind: "javascript-module";
|
|
69
|
-
path: string;
|
|
70
|
-
declarations: CemClassDeclaration[];
|
|
71
|
-
exports: CemExport[];
|
|
72
|
-
}
|
|
73
|
-
export interface CustomElementsManifest {
|
|
74
|
-
schemaVersion: "1.0.0";
|
|
75
|
-
modules: CemModule[];
|
|
76
|
-
}
|
|
77
|
-
export interface BuildCustomElementsManifestOptions {
|
|
78
|
-
/** Resolves each component's manifest `path`. Defaults to the component's `filePath` as-is. */
|
|
79
|
-
resolveModulePath?: (component: ComponentDocApi) => string;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Builds a Custom Elements Manifest (schemaVersion "1.0.0") in memory, with
|
|
83
|
-
* no file-system or `node:*` dependency so it can run in the browser (e.g.
|
|
84
|
-
* the playground).
|
|
85
|
-
*/
|
|
86
|
-
export declare function buildCustomElementsManifest(components: ComponentDocs, options?: BuildCustomElementsManifestOptions): CustomElementsManifest;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ComponentDocs } from "../plugin";
|
|
2
|
-
export type { CemAttribute, CemClassDeclaration, CemClassField, CemCustomElementExport, CemEvent, CemExport, CemJavaScriptExport, CemModule, CemSlot, CemType, CustomElementsManifest, } from "./writer-custom-elements-core";
|
|
3
|
-
export interface WriteCustomElementsOptions {
|
|
4
|
-
inputDir: string;
|
|
5
|
-
outFile: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Writes component documentation as a Custom Elements Manifest
|
|
9
|
-
* (schemaVersion "1.0.0"). Components without a `customElementTag` (i.e. not
|
|
10
|
-
* compiled with `<svelte:options customElement="..." />`) still emit a plain
|
|
11
|
-
* class declaration; the manifest is most useful for `customElement`-compiled
|
|
12
|
-
* builds, where editors, Storybook, and other CEM-aware tooling can resolve
|
|
13
|
-
* `tagName`, `attributes`, and `events`.
|
|
14
|
-
*/
|
|
15
|
-
export default function writeCustomElements(components: ComponentDocs, options: WriteCustomElementsOptions): Promise<void>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { EntryExports } from "../parse-entry-exports";
|
|
2
|
-
import type { ComponentDocs } from "../plugin";
|
|
3
|
-
export interface WriteJsonOptions {
|
|
4
|
-
input: string;
|
|
5
|
-
inputDir: string;
|
|
6
|
-
outFile: string;
|
|
7
|
-
outDir?: string;
|
|
8
|
-
/** Entry-barrel exports when `documentExports` is on. */
|
|
9
|
-
entryExports?: EntryExports;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* // Per-component files:
|
|
15
|
-
* await writeJson(components, {
|
|
16
|
-
* inputDir: "./src",
|
|
17
|
-
* outDir: "./dist"
|
|
18
|
-
* });
|
|
19
|
-
*
|
|
20
|
-
* // Single combined file:
|
|
21
|
-
* await writeJson(components, {
|
|
22
|
-
* inputDir: "./src",
|
|
23
|
-
* outFile: "components.api.json"
|
|
24
|
-
* });
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export default function writeJson(components: ComponentDocs, options: WriteJsonOptions): Promise<void>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ComponentDocs } from "../plugin";
|
|
2
|
-
import { type AppendType, MarkdownWriterBaseImpl } from "./MarkdownWriterBase";
|
|
3
|
-
export type { AppendType };
|
|
4
|
-
type OnAppend = (type: AppendType, document: BrowserWriterMarkdown) => void;
|
|
5
|
-
interface MarkdownOptions {
|
|
6
|
-
onAppend?: OnAppend;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Browser-compatible WriterMarkdown that doesn't extend Writer.
|
|
10
|
-
*
|
|
11
|
-
* This class is designed for browser environments where file system operations
|
|
12
|
-
* are not available. It extends MarkdownWriterBaseImpl directly instead of
|
|
13
|
-
* Writer to avoid Node.js dependencies.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const writer = new BrowserWriterMarkdown({
|
|
18
|
-
* onAppend: (type, doc) => {
|
|
19
|
-
* console.log(`Appended ${type} to document`);
|
|
20
|
-
* }
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare class BrowserWriterMarkdown extends MarkdownWriterBaseImpl {
|
|
25
|
-
onAppend?: OnAppend;
|
|
26
|
-
constructor(options: MarkdownOptions);
|
|
27
|
-
append(type: AppendType, raw?: string): this;
|
|
28
|
-
}
|
|
29
|
-
export interface WriteMarkdownCoreOptions {
|
|
30
|
-
onAppend?: (type: AppendType, document: BrowserWriterMarkdown, components: ComponentDocs) => void;
|
|
31
|
-
}
|
|
32
|
-
export declare function writeMarkdownCore(components: ComponentDocs, options?: WriteMarkdownCoreOptions): string;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EntryExports } from "../parse-entry-exports";
|
|
2
|
-
import type { ComponentDocs } from "../plugin";
|
|
3
|
-
import WriterMarkdown, { type AppendType } from "./WriterMarkdown";
|
|
4
|
-
export interface WriteMarkdownOptions {
|
|
5
|
-
write?: boolean;
|
|
6
|
-
outFile: string;
|
|
7
|
-
/** Entry-barrel exports when `documentExports` is on. */
|
|
8
|
-
entryExports?: EntryExports;
|
|
9
|
-
onAppend?: (type: AppendType, document: WriterMarkdown, components: ComponentDocs) => void;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const markdown = await writeMarkdown(components, {
|
|
15
|
-
* outFile: "COMPONENTS.md",
|
|
16
|
-
* write: true,
|
|
17
|
-
* onAppend: (type, doc) => {
|
|
18
|
-
* console.log(`Appended ${type}`);
|
|
19
|
-
* }
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export default function writeMarkdown(components: ComponentDocs, options: WriteMarkdownOptions): Promise<string>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ComponentDocApi } from "../plugin";
|
|
2
|
-
export declare function formatTsProps(props?: string): string;
|
|
3
|
-
export declare function getTypeDefs(def: Pick<ComponentDocApi, "typedefs">): string;
|
|
4
|
-
/**
|
|
5
|
-
* Exported context type definitions for a component.
|
|
6
|
-
*
|
|
7
|
-
* @param def - Component documentation containing contexts and generics
|
|
8
|
-
* @returns TypeScript type definition string, or empty string if no contexts
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* // export type ModalContext<T> = {
|
|
13
|
-
* // open: () => void;
|
|
14
|
-
* // close: () => void;
|
|
15
|
-
* // };
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function getContextDefs(def: Pick<ComponentDocApi, "contexts" | "generics">): string;
|
|
19
|
-
export interface WriteTsDefinitionOptions {
|
|
20
|
-
/**
|
|
21
|
-
* `"class"` (default) extends the deprecated `SvelteComponentTyped`.
|
|
22
|
-
* `"component"` emits `declare const X: Component<Props, Exports, Bindings>`
|
|
23
|
-
* instead, for Svelte 5+ consumers. Generic components get a per-component
|
|
24
|
-
* interface with a generic call signature instead of `Component<...>`
|
|
25
|
-
* directly, since a `declare const` can't itself carry a generic type
|
|
26
|
-
* parameter (see `genGenericComponentDeclaration`).
|
|
27
|
-
*/
|
|
28
|
-
format?: "class" | "component";
|
|
29
|
-
}
|
|
30
|
-
export declare function writeTsDefinition(component: ComponentDocApi, options?: WriteTsDefinitionOptions): string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ParsedExports } from "../parse-exports";
|
|
2
|
-
import type { ComponentDocs } from "../plugin";
|
|
3
|
-
import { type WriteTsDefinitionOptions } from "./writer-ts-definitions-core";
|
|
4
|
-
/**
|
|
5
|
-
* Re-export browser-compatible functions from core module.
|
|
6
|
-
*
|
|
7
|
-
* These functions are exported from the core TypeScript definitions writer
|
|
8
|
-
* to provide a browser-compatible API surface. The core module contains the
|
|
9
|
-
* actual implementation logic.
|
|
10
|
-
*
|
|
11
|
-
* @see {@link ./writer-ts-definitions-core} for the core implementation
|
|
12
|
-
*/
|
|
13
|
-
export { formatTsProps, getContextDefs, getTypeDefs, type WriteTsDefinitionOptions, writeTsDefinition, } from "./writer-ts-definitions-core";
|
|
14
|
-
/**
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const options: WriteTsDefinitionsOptions = {
|
|
18
|
-
* outDir: "./dist",
|
|
19
|
-
* inputDir: "./src",
|
|
20
|
-
* preamble: "// Generated by sveld\n",
|
|
21
|
-
* exports: { ... }
|
|
22
|
-
* };
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export interface WriteTsDefinitionsOptions extends WriteTsDefinitionOptions {
|
|
26
|
-
outDir: string;
|
|
27
|
-
inputDir: string;
|
|
28
|
-
preamble: string;
|
|
29
|
-
exports: ParsedExports;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* await writeTsDefinitions(components, {
|
|
35
|
-
* outDir: "./dist",
|
|
36
|
-
* inputDir: "./src",
|
|
37
|
-
* preamble: "// Generated\n",
|
|
38
|
-
* exports: { ... }
|
|
39
|
-
* });
|
|
40
|
-
* // Creates dist/Button.d.ts, dist/Input.d.ts, dist/index.d.ts
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export default function writeTsDefinitions(components: ComponentDocs, options: WriteTsDefinitionsOptions): Promise<void>;
|