sheets-translate-to-json
Version:
A Node.js library that facilitates the retrieval and conversion of previously translated Google Sheets spreadsheets into structured JSON files, optimizing the management of localized resources.
24 lines (22 loc) • 728 B
text/typescript
interface NestedObject {
[key: string]: string | NestedObject | undefined;
}
interface SheetData {
[key: string]: NestedObject;
}
declare class SheetManager {
private doc;
private jwt;
constructor(privateKey: string, clientEmail: string, sheetId: string);
init(userPath: string, sheetNames?: string[]): Promise<void>;
read(sheetPosition?: number): Promise<SheetData>;
readByName(sheetName: string): Promise<SheetData>;
readAllSheets(): Promise<{
[sheetName: string]: SheetData;
}>;
private processSheet;
private setNestedValue;
write(data: SheetData, directoryPath: string, sheetPrefix?: string): void;
listSheets(): Promise<string[]>;
}
export { SheetManager };