Skip to content

Commit 9632d0f

Browse files
committed
More doc strings
1 parent 3df5bb8 commit 9632d0f

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",
@@ -130,6 +137,14 @@ const defaultSpokenFormMapCore: DefaultSpokenFormMapDefinition = {
130137
customRegex: {},
131138
};
132139

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

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

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

0 commit comments

Comments
 (0)