Skip to content

Commit cce8c12

Browse files
committed
Add type "GSUB" | "GPOS" annotation to layout functions
1 parent 0af07a8 commit cce8c12

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/face.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class Face {
100100
* @param table The table to query, either "GSUB" or "GPOS".
101101
* @returns An array of 4-character script tag strings.
102102
*/
103-
getTableScriptTags(table: string): string[] {
103+
getTableScriptTags(table: "GSUB" | "GPOS"): string[] {
104104
const sp = Module.stackSave();
105105
const tableTag = hb_tag(table);
106106
let startOffset = 0;
@@ -135,7 +135,7 @@ export class Face {
135135
* @param table The table to query, either "GSUB" or "GPOS".
136136
* @returns An array of 4-character feature tag strings.
137137
*/
138-
getTableFeatureTags(table: string): string[] {
138+
getTableFeatureTags(table: "GSUB" | "GPOS"): string[] {
139139
const sp = Module.stackSave();
140140
const tableTag = hb_tag(table);
141141
let startOffset = 0;
@@ -171,7 +171,7 @@ export class Face {
171171
* @param scriptIndex The index of the script to query.
172172
* @returns An array of 4-character language tag strings.
173173
*/
174-
getScriptLanguageTags(table: string, scriptIndex: number): string[] {
174+
getScriptLanguageTags(table: "GSUB" | "GPOS", scriptIndex: number): string[] {
175175
const sp = Module.stackSave();
176176
const tableTag = hb_tag(table);
177177
let startOffset = 0;
@@ -210,7 +210,7 @@ export class Face {
210210
* @returns An array of 4-character feature tag strings.
211211
*/
212212
getLanguageFeatureTags(
213-
table: string,
213+
table: "GSUB" | "GPOS",
214214
scriptIndex: number,
215215
languageIndex: number,
216216
): string[] {
@@ -251,7 +251,7 @@ export class Face {
251251
* @param featureIndex The index of the requested feature.
252252
* @returns An array of lookup indexes.
253253
*/
254-
getFeatureLookups(table: string, featureIndex: number): number[] {
254+
getFeatureLookups(table: "GSUB" | "GPOS", featureIndex: number): number[] {
255255
const sp = Module.stackSave();
256256
const tableTag = hb_tag(table);
257257
let startOffset = 0;
@@ -346,7 +346,7 @@ export class Face {
346346
* @returns An object with name IDs, or undefined if not found.
347347
*/
348348
getFeatureNameIds(
349-
table: string,
349+
table: "GSUB" | "GPOS",
350350
featureIndex: number,
351351
): FeatureNameIds | undefined {
352352
const sp = Module.stackSave();

0 commit comments

Comments
 (0)