Skip to content

Commit 69360d8

Browse files
committed
More doc strings
1 parent d70b0f4 commit 69360d8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

packages/cursorless-engine/src/DefaultSpokenFormMap.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ type DefaultSpokenFormMapDefinition = {
1212
>;
1313
};
1414

15+
/**
16+
* This map contains the default spoken forms for all our speakable entities,
17+
* including scope types, paired delimiters, etc. We would like this map to
18+
* become the sole source of truth for our default spoken forms, including the
19+
* Talon side. Today it is only used on the extension side for testing, and as a
20+
* fallback when we can't get the custom spoken forms from Talon.
21+
*/
1522
const defaultSpokenFormMapCore: DefaultSpokenFormMapDefinition = {
1623
pairedDelimiter: {
1724
curlyBrackets: "curly",
@@ -129,6 +136,14 @@ const defaultSpokenFormMapCore: DefaultSpokenFormMapDefinition = {
129136
customRegex: {},
130137
};
131138

139+
/**
140+
* Used to construct entities that should not be speakable by default.
141+
*
142+
* @param spokenForms The default spoken forms for this entity
143+
* @returns A DefaultSpokenFormMapEntry with the given spoken forms, and
144+
* {@link DefaultSpokenFormMapEntry.isDisabledByDefault|isDisabledByDefault} set
145+
* to true
146+
*/
132147
function disabledByDefault(
133148
...spokenForms: string[]
134149
): DefaultSpokenFormMapEntry {
@@ -139,6 +154,14 @@ function disabledByDefault(
139154
};
140155
}
141156

157+
/**
158+
* Used to construct entities that are only for internal experimentation.
159+
*
160+
* @param spokenForms The default spoken forms for this entity
161+
* @returns A DefaultSpokenFormMapEntry with the given spoken forms, and
162+
* {@link DefaultSpokenFormMapEntry.isDisabledByDefault|isDisabledByDefault} and
163+
* {@link DefaultSpokenFormMapEntry.isSecret|isSecret} set to true
164+
*/
142165
function secret(...spokenForms: string[]): DefaultSpokenFormMapEntry {
143166
return {
144167
defaultSpokenForms: spokenForms,
@@ -149,7 +172,18 @@ function secret(...spokenForms: string[]): DefaultSpokenFormMapEntry {
149172

150173
export interface DefaultSpokenFormMapEntry {
151174
defaultSpokenForms: string[];
175+
176+
/**
177+
* If `true`, indicates that the entry may have a default spoken form, but
178+
* it should not be enabled by default. These will show up in user csv's with
179+
* a `-` at the beginning.
180+
*/
152181
isDisabledByDefault: boolean;
182+
183+
/**
184+
* If `true`, indicates that the entry is only for internal experimentation,
185+
* and should not be exposed to users except within a targeted working group.
186+
*/
153187
isSecret: boolean;
154188
}
155189

0 commit comments

Comments
 (0)