your personal website on atproto - mirror blento.app
at blog-embeds 15 lines 507 B view raw
1import type { Component } from 'svelte'; 2 3export type EmbedComponentProps = { 4 url: string; 5 data: Record<string, unknown>; 6}; 7 8export type EmbedDefinition = { 9 /** Unique identifier, e.g. 'youtube', 'spotify' */ 10 type: string; 11 /** Attempt to match a URL. Return provider-specific data on success, or null on failure. */ 12 match: (url: string) => Record<string, unknown> | null; 13 /** Svelte component used to render the embed. Receives EmbedComponentProps. */ 14 component: Component<EmbedComponentProps>; 15};