@mdsvex/language-core 0.1.0-next.1 → 0.1.0-next.2
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/dist/_svelte_shims.d.ts +1 -0
- package/dist/completions.d.ts +51 -0
- package/dist/config.d.ts +48 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1253 -0
- package/dist/language_plugin.d.ts +53 -0
- package/dist/svelte_plugin.d.ts +14 -0
- package/package.json +16 -7
- package/CHANGELOG.md +0 -37
- package/src/_svelte_shims.ts +0 -1
- package/src/completions.ts +0 -242
- package/src/config.ts +0 -521
- package/src/index.ts +0 -31
- package/src/language_plugin.ts +0 -556
- package/src/svelte_plugin.ts +0 -183
- package/test/completions.spec.ts +0 -179
- package/test/config.spec.ts +0 -304
- package/test/language_plugin.spec.ts +0 -236
- package/test/language_service.spec.ts +0 -314
- package/test/ts_harness.ts +0 -168
- package/tsconfig.json +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SVELTE_SHIMS = "// Whenever a ambient declaration changes, its number should be increased\n// This way, we avoid the situation where multiple ambient versions of svelte2tsx\n// are loaded and their declarations conflict each other\n// See https://github.com/sveltejs/language-tools/issues/1059 for an example bug that stems from it\n// If you change anything in this file, think about whether or not it should be backported to svelte-shims.d.ts\n\ntype AConstructorTypeOf<T, U extends any[] = any[]> = new (...args: U) => T;\n\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteActionReturnType = {\n\tupdate?: (args: any) => void,\n\tdestroy?: () => void\n} | void\n\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteTransitionConfig = {\n delay?: number,\n duration?: number,\n easing?: (t: number) => number,\n css?: (t: number, u: number) => string,\n tick?: (t: number, u: number) => void\n}\n\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteTransitionReturnType = SvelteTransitionConfig | (() => SvelteTransitionConfig)\n\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteAnimationReturnType = {\n delay?: number,\n duration?: number,\n easing?: (t: number) => number,\n css?: (t: number, u: number) => string,\n tick?: (t: number, u: number) => void\n}\n\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteWithOptionalProps<Props, Keys extends keyof Props> = Omit<Props, Keys> & Partial<Pick<Props, Keys>>;\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteAllProps = { [index: string]: any }\n/** @internal PRIVATE API, DO NOT USE */\ntype SveltePropsAnyFallback<Props> = {[K in keyof Props]: Props[K] extends never ? never : Props[K] extends undefined ? any : Props[K]}\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteSlotsAnyFallback<Slots> = {[K in keyof Slots]: {[S in keyof Slots[K]]: Slots[K][S] extends undefined ? any : Slots[K][S]}}\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteRestProps = { [index: string]: any }\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteSlots = { [index: string]: any }\n/** @internal PRIVATE API, DO NOT USE */\ntype SvelteStore<T> = { subscribe: (run: (value: T) => any, invalidate?: any) => any }\n\n// Forces TypeScript to look into the type which results in a better representation of it\n// which helps for error messages and is necessary for d.ts file transformation so that\n// no ambient type references are left in the output\n/** @internal PRIVATE API, DO NOT USE */\ntype Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;\n\n/** @internal PRIVATE API, DO NOT USE */\ntype KeysMatching<Obj, V> = {[K in keyof Obj]-?: Obj[K] extends V ? K : never}[keyof Obj]\n/** @internal PRIVATE API, DO NOT USE */\ndeclare type __sveltets_2_CustomEvents<T> = {[K in KeysMatching<T, CustomEvent>]: T[K] extends CustomEvent ? T[K]['detail']: T[K]}\n\ndeclare function __sveltets_2_ensureRightProps<Props>(props: Props): {};\ndeclare function __sveltets_2_instanceOf<T = any>(type: AConstructorTypeOf<T>): T;\ndeclare function __sveltets_2_allPropsType(): SvelteAllProps\ndeclare function __sveltets_2_restPropsType(): SvelteRestProps\ndeclare function __sveltets_2_slotsType<Slots, Key extends keyof Slots>(slots: Slots): Record<Key, boolean>;\n\n// Overload of the following two functions is necessary.\n// An empty array of optionalProps makes OptionalProps type any, which means we lose the prop typing.\n// optionalProps need to be first or its type cannot be infered correctly.\n\ndeclare function __sveltets_2_partial<Props = {}, Events = {}, Slots = {}, Exports = {}, Bindings = string>(\n render: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n): {props: Expand<SveltePropsAnyFallback<Props>>, events: Events, slots: Expand<SvelteSlotsAnyFallback<Slots>>, exports?: Exports, bindings?: Bindings }\ndeclare function __sveltets_2_partial<Props = {}, Events = {}, Slots = {}, Exports = {}, Bindings = string, OptionalProps extends keyof Props = any>(\n optionalProps: OptionalProps[],\n render: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n): {props: Expand<SvelteWithOptionalProps<SveltePropsAnyFallback<Props>, OptionalProps>>, events: Events, slots: Expand<SvelteSlotsAnyFallback<Slots>>, exports?: Exports, bindings?: Bindings }\n\ndeclare function __sveltets_2_partial_with_any<Props = {}, Events = {}, Slots = {}, Exports = {}, Bindings = string>(\n render: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n): {props: Expand<SveltePropsAnyFallback<Props> & SvelteAllProps>, events: Events, slots: Expand<SvelteSlotsAnyFallback<Slots>>, exports?: Exports, bindings?: Bindings }\ndeclare function __sveltets_2_partial_with_any<Props = {}, Events = {}, Slots = {}, Exports = {}, Bindings = string, OptionalProps extends keyof Props = any>(\n optionalProps: OptionalProps[],\n render: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n): {props: Expand<SvelteWithOptionalProps<SveltePropsAnyFallback<Props>, OptionalProps> & SvelteAllProps>, events: Events, slots: Expand<SvelteSlotsAnyFallback<Slots>>, exports?: Exports, bindings?: Bindings }\n\n\ndeclare function __sveltets_2_with_any<Props = {}, Events = {}, Slots = {}, Exports = {}, Bindings = string>(\n render: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n): {props: Expand<Props & SvelteAllProps>, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n\ndeclare function __sveltets_2_with_any_event<Props = {}, Events = {}, Slots = {}, Exports = {}, Bindings = string>(\n render: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }\n): {props: Props, events: Events & {[evt: string]: CustomEvent<any>;}, slots: Slots, exports?: Exports, bindings?: Bindings }\n\ndeclare function __sveltets_2_store_get<T = any>(store: SvelteStore<T>): T\ndeclare function __sveltets_2_store_get<Store extends SvelteStore<any> | undefined | null>(store: Store): Store extends SvelteStore<infer T> ? T : Store;\ndeclare function __sveltets_2_any(dummy: any): any;\ndeclare function __sveltets_2_invalidate<T>(getValue: () => T): T\n\ndeclare function __sveltets_2_mapWindowEvent<K extends keyof HTMLBodyElementEventMap>(\n event: K\n): HTMLBodyElementEventMap[K];\ndeclare function __sveltets_2_mapBodyEvent<K extends keyof WindowEventMap>(\n event: K\n): WindowEventMap[K];\ndeclare function __sveltets_2_mapElementEvent<K extends keyof HTMLElementEventMap>(\n event: K\n): HTMLElementEventMap[K];\n\ndeclare function __sveltets_2_bubbleEventDef<Events, K extends keyof Events>(\n events: Events, eventKey: K\n): Events[K];\ndeclare function __sveltets_2_bubbleEventDef(\n events: any, eventKey: string\n): any;\n\ndeclare const __sveltets_2_customEvent: CustomEvent<any>;\ndeclare function __sveltets_2_toEventTypings<Typings>(): {[Key in keyof Typings]: CustomEvent<Typings[Key]>};\n\ndeclare function __sveltets_2_unionType<T1, T2>(t1: T1, t2: T2): T1 | T2;\ndeclare function __sveltets_2_unionType<T1, T2, T3>(t1: T1, t2: T2, t3: T3): T1 | T2 | T3;\ndeclare function __sveltets_2_unionType<T1, T2, T3, T4>(t1: T1, t2: T2, t3: T3, t4: T4): T1 | T2 | T3 | T4;\ndeclare function __sveltets_2_unionType(...types: any[]): any;\n\ndeclare function __sveltets_2_createSvelte2TsxComponent<Props extends {}, Events extends {}, Slots extends {}>(\n render: {props: Props, events: Events, slots: Slots }\n): typeof import(\"svelte\").SvelteComponent<Props, Events, Slots>;\n\ndeclare function __sveltets_2_unwrapArr<T>(arr: ArrayLike<T>): T\ndeclare function __sveltets_2_unwrapPromiseLike<T>(promise: PromiseLike<T> | T): T\n\n// v2\ndeclare function __sveltets_2_createCreateSlot<Slots = Record<string, Record<string, any>>>(): <SlotName extends keyof Slots>(slotName: SlotName, attrs: Slots[SlotName]) => Record<string, any>;\ndeclare function __sveltets_2_createComponentAny(props: Record<string, any>): import(\"svelte\").SvelteComponent<any, any, any>;\n\ndeclare function __sveltets_2_any(...dummy: any[]): any;\ndeclare function __sveltets_2_empty(...dummy: any[]): {};\ndeclare function __sveltets_2_union<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>(t1:T1,t2?:T2,t3?:T3,t4?:T4,t5?:T5,t6?:T6,t7?:T7,t8?:T8,t9?:T9,t10?:T10): T1 & T2 & T3 & T4 & T5 & T6 & T7 & T8 & T9 & T10;\ndeclare function __sveltets_2_nonNullable<T>(type: T): NonNullable<T>;\n\ndeclare function __sveltets_2_cssProp(prop: Record<string, any>): {};\n\n// @ts-ignore Svelte v3/v4 don't have this\ndeclare function __sveltets_2_ensureSnippet(val: ReturnType<import('svelte').Snippet> | undefined | null): any;\n\n/** @internal PRIVATE API, DO NOT USE */\ntype __sveltets_2_SvelteAnimationReturnType = {\n delay?: number,\n duration?: number,\n easing?: (t: number) => number,\n css?: (t: number, u: number) => string,\n tick?: (t: number, u: number) => void\n}\ndeclare var __sveltets_2_AnimationMove: { from: DOMRect, to: DOMRect }\ndeclare function __sveltets_2_ensureAnimation(animationCall: __sveltets_2_SvelteAnimationReturnType): {};\n\n/** @internal PRIVATE API, DO NOT USE */\ntype __sveltets_2_SvelteActionReturnType = {\n\tupdate?: (args: any) => void,\n\tdestroy?: () => void,\n $$_attributes?: Record<string, any>,\n} | void\ndeclare function __sveltets_2_ensureAction<T extends __sveltets_2_SvelteActionReturnType>(actionCall: T): T extends {$$_attributes?: any} ? T['$$_attributes'] : {};\n\n/** @internal PRIVATE API, DO NOT USE */\ntype __sveltets_2_SvelteTransitionConfig = {\n delay?: number,\n duration?: number,\n easing?: (t: number) => number,\n css?: (t: number, u: number) => string,\n tick?: (t: number, u: number) => void\n}\n/** @internal PRIVATE API, DO NOT USE */\ntype __sveltets_2_SvelteTransitionReturnType = __sveltets_2_SvelteTransitionConfig | (() => __sveltets_2_SvelteTransitionConfig)\ndeclare function __sveltets_2_ensureTransition(transitionCall: __sveltets_2_SvelteTransitionReturnType): {};\n\n// Includes undefined and null for all types as all usages also allow these\ndeclare function __sveltets_2_ensureType<T>(type: AConstructorTypeOf<T>, el: T | undefined | null): {};\ndeclare function __sveltets_2_ensureType<T1, T2>(type1: AConstructorTypeOf<T1>, type2: AConstructorTypeOf<T2>, el: T1 | T2 | undefined | null): {};\n\n// The following is necessary because there are two clashing errors that can't be solved at the same time\n// when using Svelte2TsxComponent, more precisely the event typings in\n// __sveltets_2_ensureComponent<T extends new (..) => _SvelteComponent<any,||any||<-this,any>>(type: T): T;\n// If we type it as \"any\", we have an error when using sth like {a: CustomEvent<any>}\n// If we type it as \"{}\", we have an error when using sth like {[evt: string]: CustomEvent<any>}\n// If we type it as \"unknown\", we get all kinds of follow up errors which we want to avoid\n// Therefore introduce two more base classes just for this case.\n/**\n * Ambient type only used for intellisense, DO NOT USE IN YOUR PROJECT\n */\ndeclare type ATypedSvelteComponent = {\n /**\n * @internal This is for type checking capabilities only\n * and does not exist at runtime. Don't use this property.\n */\n $$prop_def: any;\n /**\n * @internal This is for type checking capabilities only\n * and does not exist at runtime. Don't use this property.\n */\n $$events_def: any;\n /**\n * @internal This is for type checking capabilities only\n * and does not exist at runtime. Don't use this property.\n */\n $$slot_def: any;\n\n $on(event: string, handler: any): () => void;\n}\n/**\n * Ambient type only used for intellisense, DO NOT USE IN YOUR PROJECT.\n * \n * If you're looking for the type of a Svelte Component, use `SvelteComponent` and `ComponentType` instead:\n *\n * ```ts\n * import type { ComponentType, SvelteComponent } from \"svelte\";\n * let myComponentConstructor: ComponentType<SvelteComponent> = ..;\n * ```\n */\ndeclare type ConstructorOfATypedSvelteComponent = new (args: {target: any, props?: any}) => ATypedSvelteComponent\n// Usage note: Cannot properly transform generic function components to class components due to TypeScript limitations\ndeclare function __sveltets_2_ensureComponent<\n T extends\n | ConstructorOfATypedSvelteComponent\n | (typeof import('svelte') extends { mount: any }\n ? // @ts-ignore svelte.Component doesn't exist in Svelte 4\n import('svelte').Component<any, any, any>\n : never)\n | null\n | undefined\n>(\n type: T\n): NonNullable<\n T extends ConstructorOfATypedSvelteComponent\n ? T\n : typeof import('svelte') extends { mount: any }\n ? // @ts-ignore svelte.Component doesn't exist in Svelte 4\n T extends import('svelte').Component<\n infer Props extends Record<string, any>,\n infer Exports extends Record<string, any>,\n infer Bindings extends string\n >\n ? new (\n options: import('svelte').ComponentConstructorOptions<Props>\n ) => import('svelte').SvelteComponent<Props, Props['$$events'], Props['$$slots']> &\n Exports & { $$bindings: Bindings }\n : never\n : never\n>;\n\ndeclare function __sveltets_2_ensureArray<T extends ArrayLike<unknown> | Iterable<unknown>>(\n // Svelte 5 allows undefined or null here, Svelte 4 doesn't\n array: T | (typeof import('svelte') extends { mount: any } ? (undefined | null) : never)\n): T extends ArrayLike<infer U> ? U[] : T extends Iterable<infer U> ? Iterable<U> : any[];\n\ntype __sveltets_2_PropsWithChildren<Props, Slots> = Props &\n (Slots extends { default: any }\n // This is unfortunate because it means \"accepts no props\" turns into \"accepts any prop\"\n // but the alternative is non-fixable type errors because of the way TypeScript index\n // signatures work (they will always take precedence and make an impossible-to-satisfy children type).\n ? Props extends Record<string, never>\n ? any\n : { children?: any }\n : {});\ndeclare function __sveltets_2_runes_constructor<Props extends {}>(render: {props: Props }): import(\"svelte\").ComponentConstructorOptions<Props>;\n\ndeclare function __sveltets_2_get_set_binding<T>(get: (() => T) | null | undefined, set: (t: T) => void): T;\n\ndeclare function __sveltets_$$bindings<Bindings extends string[]>(...bindings: Bindings): Bindings[number];\n\ndeclare function __sveltets_2_fn_component<\n Props extends Record<string, any>, Exports extends Record<string, any>, Bindings extends string\n // @ts-ignore Svelte 5 only\n>(klass: {props: Props, exports?: Exports, bindings?: Bindings }): import('svelte').Component<Props, Exports, Bindings>;\n\ninterface __sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {\n new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { $$bindings?: Bindings } & Exports;\n (internal: unknown, props: Props extends Record<string, never> ? {$$events?: Events, $$slots?: Slots} : Props & {$$events?: Events, $$slots?: Slots}): Exports & { $set?: any, $on?: any };\n z_$$bindings?: Bindings;\n}\n\ndeclare function __sveltets_2_isomorphic_component<\n Props extends Record<string, any>, Events extends Record<string, any>, Slots extends Record<string, any>, Exports extends Record<string, any>, Bindings extends string\n>(klass: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }): __sveltets_2_IsomorphicComponent<Props, Events, Slots, Exports, Bindings>;\n\ndeclare function __sveltets_2_isomorphic_component_slots<\n Props extends Record<string, any>, Events extends Record<string, any>, Slots extends Record<string, any>, Exports extends Record<string, any>, Bindings extends string\n>(klass: {props: Props, events: Events, slots: Slots, exports?: Exports, bindings?: Bindings }): __sveltets_2_IsomorphicComponent<__sveltets_2_PropsWithChildren<Props, Slots>, Events, Slots, Exports, Bindings>;\n";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* what to complete in frontmatter and directive args, the props come from
|
|
3
|
+
* the type alias pfm_to_svelte emits for each template and directive
|
|
4
|
+
*/
|
|
5
|
+
import type * as TS from 'typescript';
|
|
6
|
+
import type { PropsProbe } from '@mdsvex/source-map/pfm-to-svelte';
|
|
7
|
+
interface Range {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
}
|
|
11
|
+
export type CompletionContext = {
|
|
12
|
+
kind: 'template';
|
|
13
|
+
range: Range;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'frontmatter_key';
|
|
16
|
+
range: Range;
|
|
17
|
+
existing: string[];
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'frontmatter_value';
|
|
20
|
+
key: string;
|
|
21
|
+
range: Range;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'arg_key';
|
|
24
|
+
directive: string;
|
|
25
|
+
inline: boolean;
|
|
26
|
+
range: Range;
|
|
27
|
+
existing: string[];
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'arg_value';
|
|
30
|
+
directive: string;
|
|
31
|
+
key: string;
|
|
32
|
+
range: Range;
|
|
33
|
+
};
|
|
34
|
+
/** what the offset completes, null for nothing this module offers */
|
|
35
|
+
export declare function completion_context(source: string, offset: number, frontmatter: Range | null): CompletionContext | null;
|
|
36
|
+
/** the template a frontmatter names, undefined when it names none */
|
|
37
|
+
export declare function template_named(source: string, frontmatter: Range | null): string | false | undefined;
|
|
38
|
+
/** the probe of a template, or of a directive in the scope of a template */
|
|
39
|
+
export declare function probe_for(probes: PropsProbe[], kind: PropsProbe['kind'], name: string, template: string | undefined): PropsProbe | undefined;
|
|
40
|
+
export interface Prop {
|
|
41
|
+
name: string;
|
|
42
|
+
/** the type as typescript prints it */
|
|
43
|
+
type: string;
|
|
44
|
+
optional: boolean;
|
|
45
|
+
documentation: string;
|
|
46
|
+
/** the literal values the type allows, as yaml or an arg writes them */
|
|
47
|
+
values: string[];
|
|
48
|
+
}
|
|
49
|
+
/** the props a probe names, null when the program does not hold it */
|
|
50
|
+
export declare function props_of(ts: typeof TS, program: TS.Program, file: string, alias: string): Prop[] | null;
|
|
51
|
+
export {};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* the mdsvex config of a document without running vite, from the nearest
|
|
3
|
+
* manifest the plugin wrote or else the nearest mdsvex.config.json
|
|
4
|
+
*/
|
|
5
|
+
import type * as TS from 'typescript';
|
|
6
|
+
import { CONFIG_FILE } from 'mdsvex/host';
|
|
7
|
+
import type { ConfigExports, JsonConfig, MdsvexManifest } from 'mdsvex/host';
|
|
8
|
+
import type { PfmToSvelteOptions } from '@mdsvex/source-map/pfm-to-svelte';
|
|
9
|
+
export { CONFIG_FILE };
|
|
10
|
+
export type { JsonConfig };
|
|
11
|
+
export interface LoadedConfig {
|
|
12
|
+
/** the file read, the manifest or the json config */
|
|
13
|
+
file: string;
|
|
14
|
+
/** changes whenever the file does, for caches */
|
|
15
|
+
stamp: string;
|
|
16
|
+
manifest: MdsvexManifest;
|
|
17
|
+
}
|
|
18
|
+
/** the options a document converts with, and a stamp to cache them by */
|
|
19
|
+
export interface DocumentOptions {
|
|
20
|
+
stamp: string;
|
|
21
|
+
options: PfmToSvelteOptions;
|
|
22
|
+
}
|
|
23
|
+
export interface ConfigLoader {
|
|
24
|
+
/** the nearest config of a file, null without one */
|
|
25
|
+
load(file: string): LoadedConfig | null;
|
|
26
|
+
options_for(file: string): DocumentOptions;
|
|
27
|
+
}
|
|
28
|
+
export interface ConfigLoaderOptions {
|
|
29
|
+
/** reads the exports of templates a mdsvex.config.json names, without it they replace nothing */
|
|
30
|
+
typescript?: typeof TS;
|
|
31
|
+
/** called with each config file read, so a server can watch it */
|
|
32
|
+
on_read?: (file: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function create_config_loader(loader_options?: ConfigLoaderOptions): ConfigLoader;
|
|
35
|
+
/** the conversion options of doc under manifest */
|
|
36
|
+
export declare function document_options(manifest: MdsvexManifest, doc: string): PfmToSvelteOptions;
|
|
37
|
+
/** a manifest from mdsvex.config.json in dir, entries that do not resolve are left out */
|
|
38
|
+
export declare function from_json(config: JsonConfig, dir: string, ts: typeof TS | undefined): MdsvexManifest;
|
|
39
|
+
/**
|
|
40
|
+
* the names a module exports without running it, of a svelte file its module
|
|
41
|
+
* script, types stripped by typescript so it needs no vite
|
|
42
|
+
*/
|
|
43
|
+
export declare function scan_exports(file: string, ts: typeof TS | undefined): ConfigExports;
|
|
44
|
+
/**
|
|
45
|
+
* resolves spec as an import from importer would, for relative paths, file
|
|
46
|
+
* urls, package.json subpath imports and package exports, never vite aliases
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolve_specifier(spec: string, importer: string): string | null;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { create_pfm_language_plugin, is_document } from "./language_plugin.js";
|
|
2
|
+
export { create_svelte_language_plugin } from "./svelte_plugin.js";
|
|
3
|
+
export { CONFIG_FILE, create_config_loader, document_options, from_json, resolve_specifier, scan_exports, } from "./config.js";
|
|
4
|
+
export type { PfmLanguagePluginOptions, PfmVirtualCode, TemplateChoice, } from "./language_plugin.js";
|
|
5
|
+
export { template_value_at } from "@mdsvex/source-map/pfm-to-svelte";
|
|
6
|
+
export { completion_context, probe_for, props_of, template_named, } from "./completions.js";
|
|
7
|
+
export type { CompletionContext, Prop } from "./completions.js";
|
|
8
|
+
export type { ConfigLoader, ConfigLoaderOptions, DocumentOptions, JsonConfig, LoadedConfig, } from "./config.js";
|