11import { createHighlighter , createCssVariablesTheme } from "shiki" ;
22import type { BundledLanguage } from "shiki" ;
33
4- import type { TargetPlainObject , TestCaseSnapshot } from "@cursorless/common" ;
4+ import type {
5+ Command ,
6+ CommandLatest ,
7+ PlainSpyIDERecordedValues ,
8+ TargetPlainObject ,
9+ TestCaseFixture ,
10+ TestCaseSnapshot
11+ } from "@cursorless/common" ;
512
613import { createDecorations } from "./helpers" ;
14+ import type { DataFixture } from "./loadTestCaseFixture" ;
715
816type Lang = BundledLanguage ;
917
@@ -17,10 +25,7 @@ const myTheme = createCssVariablesTheme({
1725/**
1826 * Generates HTML content based on the provided state, language, command, and ide.
1927 *
20- * @param {TestCaseSnapshot } state - The state object containing the necessary data for HTML generation.
21- * @param {Lang } lang - The language object specifying the language for the HTML content.
22- * @param {any } [command] - (Optional) The command object specifying the command details.
23- * @param {any } [ide] - (Optional) The ide object specifying the IDE details.
28+ * @param {DataFixture } data - The state object containing the necessary data for HTML generation.
2429 * @returns {Promise<string> } A promise that resolves to the generated HTML content.
2530 */
2631export async function generateHtml ( {
@@ -46,6 +51,15 @@ const highlighter = createHighlighter({
4651 langs : [ "javascript" , "typescript" ] ,
4752} ) ;
4853
54+ type StepNameType = "before" | "during" | "after"
55+ type ExtendedTestCaseSnapshot = TestCaseSnapshot &
56+ Partial < PlainSpyIDERecordedValues > &
57+ {
58+ finalStateMarkHelpers ?: {
59+ thatMark ?: TargetPlainObject [ ] , sourceMark ?: TargetPlainObject [ ]
60+ }
61+ } ;
62+
4963class HTMLGenerator {
5064 private state : TestCaseSnapshot ;
5165 private lang : Lang ;
0 commit comments