UNPKG

@notion-md-converter/core

Version:
39 lines (38 loc) 1.59 kB
import { CaptionMetadata } from "../rich-text/CaptionMetadata"; declare const getType: (url: string) => "x" | "codesandbox" | "codepen" | "github" | "github-gist" | "asciinema" | "figma" | "speaker-deck" | "slideshare" | "google-slide" | "docswell" | "youtube" | "jsfiddle" | "stackblitz" | "blueprintue" | null; export type ProviderType = Exclude<ReturnType<typeof getType>, null>; export type EmbedYoutubeOptions = { width?: string; height?: string; }; export declare const ProviderYoutubeUtils: { getVideoIdFromUrl: (url: string) => string | null; embed: (url: string, options?: EmbedYoutubeOptions) => string | null; }; /** * CodePen */ export type EmbedCodePenOptions = { height?: string; defaultTab?: string; }; export declare const ProviderCodePenUtils: { embed: (url: string, options?: EmbedCodePenOptions) => string; }; export declare const ProviderAsciinemaUtils: { embed: (url: string) => string | null; }; /** * common */ type SupportedProviderType = Extract<ProviderType, "youtube" | "codepen" | "asciinema">; export type SupportedEmbedProviders = { [key in SupportedProviderType]: boolean; }; export declare const ProviderUtils: { getType: (url: string) => "x" | "codesandbox" | "codepen" | "github" | "github-gist" | "asciinema" | "figma" | "speaker-deck" | "slideshare" | "google-slide" | "docswell" | "youtube" | "jsfiddle" | "stackblitz" | "blueprintue" | null; embedByUrl: (url: string, metadata?: CaptionMetadata, options?: { supportedEmbedProviders?: SupportedEmbedProviders; }) => string | null; }; export {};