feat(truncate): integrate Truncate with v11

This commit is contained in:
Eric Liu 2024-04-21 12:56:28 -07:00
commit 6c2d416721
8 changed files with 57 additions and 41 deletions

View file

@ -1,7 +1,9 @@
// @ts-check
/**
* Svelte action that applies single-line text truncation to an element
* @typedef {{ clamp?: "end" | "front" }} TruncateOptions
* @type {(node: HTMLElement, options?: TruncateOptions) => { update: (options?: TruncateOptions) => void; }}
* @type {import ("svelte/action").Action<HTMLElement, TruncateOptions>}
* @example
* <h1 use:truncate>...</h1>
* <h1 use:truncate={{ clamp: "front" }}>...</h1>