@jirkasa/code-box
Version:
Showcase code samples on the web with a container that lets users select and display different samples.
33 lines (32 loc) • 1.61 kB
TypeScript
import CodeView from "../../code-view/CodeView";
import CodeBox from "../CodeBox";
import CodeBoxMemento, { CodeViewMementoEntry, FileMementoEntry } from "../CodeBoxMemento";
import TabCodeBox from "./TabCodeBox";
/** Code view entry for tab code box memento. */
export type TabCodeBoxCodeViewMementoEntry = {
/** Position of code view button. */
position: number;
} & CodeViewMementoEntry;
/** File entry for tab code box memento. */
export type TabCodeBoxFileMementoEntry = {
/** Position of file button. */
position: number;
} & FileMementoEntry;
/** Represents saved state of tab code box. */
declare class TabCodeBoxMemento extends CodeBoxMemento {
/** Code view entries (code views in code box when memento was created). */
private tabCodeBoxCodeViewEntries;
/** File entries (files in code box when memento was created). */
private tabCodeBoxFileEntries;
/**
* Creates new tab code box memento.
* @param creator Code box based on which the memento is created.
* @param addCodeViewToCreatorCodeBox Function to add code view without making copy to code box based on which the memento was created.
* @param codeViewEntries Code view entries.
* @param fileEntries File entries.
* @param activeCodeView Active code view.
*/
constructor(creator: TabCodeBox, addCodeViewToCreatorCodeBox: (identifier: string, codeView: CodeView) => void, codeViewEntries: TabCodeBoxCodeViewMementoEntry[], fileEntries: TabCodeBoxFileMementoEntry[], activeCodeView: CodeView | null);
apply(codeBox: CodeBox): void;
}
export default TabCodeBoxMemento;