pull/15045/head
Rich Harris 8 months ago
parent e0620a130b
commit 2ae3aa0993

@ -30,7 +30,7 @@ await createBundle({
[pkg.name]: `${dir}/src/index.d.ts`, [pkg.name]: `${dir}/src/index.d.ts`,
[`${pkg.name}/action`]: `${dir}/src/action/public.d.ts`, [`${pkg.name}/action`]: `${dir}/src/action/public.d.ts`,
[`${pkg.name}/animate`]: `${dir}/src/animate/public.d.ts`, [`${pkg.name}/animate`]: `${dir}/src/animate/public.d.ts`,
[`${pkg.name}/attachments`]: `${dir}/src/attachments/public.d.ts`, [`${pkg.name}/attachments`]: `${dir}/src/attachments/index.js`,
[`${pkg.name}/compiler`]: `${dir}/src/compiler/public.d.ts`, [`${pkg.name}/compiler`]: `${dir}/src/compiler/public.d.ts`,
[`${pkg.name}/easing`]: `${dir}/src/easing/index.js`, [`${pkg.name}/easing`]: `${dir}/src/easing/index.js`,
[`${pkg.name}/legacy`]: `${dir}/src/legacy/legacy-client.js`, [`${pkg.name}/legacy`]: `${dir}/src/legacy/legacy-client.js`,

@ -1,6 +1,6 @@
import { effect } from '../../reactivity/effects.js'; import { effect } from '../../reactivity/effects.js';
const key = `@attach-${Math.random().toString(36).slice(2)}`; const key = `@attach-${/*@__PURE__*/ Math.random().toString(36).slice(2)}`;
const name = `Symbol(${key})`; const name = `Symbol(${key})`;
// TODO this feels a bit belt-and-braces to me, tbh — are we sure we need it? // TODO this feels a bit belt-and-braces to me, tbh — are we sure we need it?

@ -621,6 +621,19 @@ declare module 'svelte/animate' {
export {}; export {};
} }
declare module 'svelte/attachments' {
/**
* Creates a `Symbol` that Svelte recognises as an attachment key
*/
export function createAttachmentKey(): symbol;
/**
* Returns `true` if the symbol was created with `createAttachmentKey`
* */
export function isAttachmentKey(key: string | symbol): boolean;
export {};
}
declare module 'svelte/compiler' { declare module 'svelte/compiler' {
import type { Expression, Identifier, ArrayExpression, ArrowFunctionExpression, VariableDeclaration, VariableDeclarator, MemberExpression, Node, ObjectExpression, Pattern, Program, ChainExpression, SimpleCallExpression, SequenceExpression } from 'estree'; import type { Expression, Identifier, ArrayExpression, ArrowFunctionExpression, VariableDeclaration, VariableDeclarator, MemberExpression, Node, ObjectExpression, Pattern, Program, ChainExpression, SimpleCallExpression, SequenceExpression } from 'estree';
import type { SourceMap } from 'magic-string'; import type { SourceMap } from 'magic-string';
@ -1050,6 +1063,12 @@ declare module 'svelte/compiler' {
expression: SimpleCallExpression | (ChainExpression & { expression: SimpleCallExpression }); expression: SimpleCallExpression | (ChainExpression & { expression: SimpleCallExpression });
} }
/** A `{@attach foo(...)} tag */
export interface AttachTag extends BaseNode {
type: 'AttachTag';
expression: Expression;
}
/** An `animate:` directive */ /** An `animate:` directive */
export interface AnimateDirective extends BaseNode { export interface AnimateDirective extends BaseNode {
type: 'AnimateDirective'; type: 'AnimateDirective';
@ -1132,7 +1151,7 @@ declare module 'svelte/compiler' {
interface BaseElement extends BaseNode { interface BaseElement extends BaseNode {
name: string; name: string;
attributes: Array<Attribute | SpreadAttribute | Directive>; attributes: Array<Attribute | SpreadAttribute | Directive | AttachTag>;
fragment: Fragment; fragment: Fragment;
} }
@ -1322,6 +1341,7 @@ declare module 'svelte/compiler' {
| AST.Attribute | AST.Attribute
| AST.SpreadAttribute | AST.SpreadAttribute
| Directive | Directive
| AST.AttachTag
| AST.Comment | AST.Comment
| Block; | Block;

Loading…
Cancel
Save