-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
210 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { TestCaseFixtureLegacy } from "../../types/TestCaseFixture"; | ||
import { TutorialId } from "../../types/tutorial.types"; | ||
|
||
export interface TutorialContentProvider { | ||
getRawTutorials(): Promise<RawTutorialContent[]>; | ||
|
||
/** | ||
* Load the "script.json" script for the current tutorial | ||
*/ | ||
loadTutorialScript(tutorialId: string): Promise<RawTutorialContent>; | ||
|
||
/** | ||
* Loads a fixture file from the tutorial directory, eg "takeNear.yml" | ||
* | ||
* @param tutorialId The tutorial id | ||
* @param fixtureName The name of the fixture, eg "takeNear.yml" | ||
* @returns A promise that resolves to the parsed fixture content | ||
*/ | ||
loadFixture( | ||
tutorialId: TutorialId, | ||
fixtureName: string, | ||
): Promise<TestCaseFixtureLegacy>; | ||
} | ||
|
||
export interface RawTutorialContent { | ||
/** | ||
* The unique identifier for the tutorial | ||
*/ | ||
id: TutorialId; | ||
|
||
/** | ||
* The title of the tutorial | ||
*/ | ||
title: string; | ||
|
||
/** | ||
* The version of the tutorial | ||
*/ | ||
version: number; | ||
|
||
/** | ||
* The steps of the current tutorial | ||
*/ | ||
steps: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/cursorless-engine/src/disabledComponents/DisabledTutorial.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { | ||
TutorialId, | ||
TutorialState, | ||
Disposable, | ||
ScopeType, | ||
} from "@cursorless/common"; | ||
import { Tutorial } from "../api/Tutorial"; | ||
|
||
export class DisabledTutorial implements Tutorial { | ||
onState(_callback: (state: TutorialState) => void): Disposable { | ||
return { dispose: () => {} }; | ||
} | ||
|
||
docsOpened(): void { | ||
// Do nothing | ||
} | ||
scopeTypeVisualized(_scopeType: ScopeType | undefined): void { | ||
// Do nothing | ||
} | ||
|
||
start(_id: number | TutorialId): Promise<void> { | ||
throw new Error("Method not implemented."); | ||
} | ||
next(): Promise<void> { | ||
throw new Error("Method not implemented."); | ||
} | ||
previous(): Promise<void> { | ||
throw new Error("Method not implemented."); | ||
} | ||
restart(): Promise<void> { | ||
throw new Error("Method not implemented."); | ||
} | ||
resume(): Promise<void> { | ||
throw new Error("Method not implemented."); | ||
} | ||
list(): Promise<void> { | ||
throw new Error("Method not implemented."); | ||
} | ||
|
||
readonly state: TutorialState = { type: "loading" }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
packages/cursorless-engine/src/tutorial/loadTutorialScript.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.