import { PartsMap } from 'tosijs'; import { TosiTabs } from '../tab-selector'; import { CodeEditor } from '../code-editor'; export interface ExampleContext { [key: string]: any; } export type Dialect = 'js' | 'tjs' | 'ts'; export interface ExampleParts extends PartsMap { codeEditors: HTMLElement; undo: HTMLButtonElement; redo: HTMLButtonElement; exampleWidgets: HTMLButtonElement; editors: TosiTabs; code: HTMLElement; sources: HTMLElement; style: HTMLStyleElement; example: HTMLElement; testResults: HTMLElement; testIndicator: HTMLElement; js: CodeEditor; html: CodeEditor; css: CodeEditor; test: CodeEditor; } export interface RemotePayload { remoteKey: string; sentAt: number; css: string; html: string; js: string; test?: string; close?: boolean; original?: { js?: string; html?: string; css?: string; test?: string; }; } export type TransformFn = (code: string, options?: { transforms: ('jsx' | 'typescript' | 'flow' | 'imports')[]; }) => { code: string; } | Promise<{ code: string; }>;