change(web): layout row id number coercion

This commit is contained in:
Joshua A. Horton 2022-10-20 08:54:19 +07:00
parent 4e609a258f
commit ecc9edeb66
2 changed files with 5 additions and 2 deletions

View file

@ -280,7 +280,7 @@ namespace com.keyman.keyboards {
// Identify key labels (e.g. *Shift*) that require the special OSK font
static readonly SPECIAL_LABEL=/\*\w+\*/;
id: string;
id: number;
key: ActiveKey[];
/**
@ -381,6 +381,9 @@ namespace com.keyman.keyboards {
let aRow = row as ActiveRow;
aRow.proportionalY = proportionalY;
if(typeof row.id == 'string') {
row.id = Number.parseInt(row.id, 10);
}
}
populateKeyMap(map: {[keyId: string]: ActiveKey}) {

View file

@ -26,7 +26,7 @@ namespace com.keyman.keyboards {
}
export type LayoutRow = {
"id": string, // represents a number, though...
"id": string | number,
"key": LayoutKey[]
};