@translated/lara
Version:
Official Lara SDK for JavaScript and Node.js
38 lines (37 loc) • 1.44 kB
TypeScript
import type { LaraClient } from "./net";
import type { MultiPartFile } from "./net/client";
export interface Glossary {
readonly id: string;
readonly name: string;
readonly ownerId: string;
readonly createdAt: Date;
readonly updatedAt: Date;
}
export interface GlossaryImport {
readonly id: string;
readonly begin: number;
readonly end: number;
readonly channel: number;
readonly size: number;
readonly progress: number;
}
export interface GlossaryCounts {
unidirectional?: Record<string, number>;
multidirectional?: number;
}
export type GlossaryImportCallback = (glossaryImport: GlossaryImport) => void;
export declare class Glossaries {
private readonly client;
private readonly pollingInterval;
constructor(client: LaraClient);
list(): Promise<Glossary[]>;
create(name: string): Promise<Glossary>;
get(id: string): Promise<Glossary | null>;
delete(id: string): Promise<Glossary>;
update(id: string, name: string): Promise<Glossary>;
importCsv(id: string, csv: MultiPartFile, gzip?: boolean): Promise<GlossaryImport>;
getImportStatus(id: string): Promise<GlossaryImport>;
waitForImport(gImport: GlossaryImport, updateCallback?: GlossaryImportCallback, maxWaitTime?: number): Promise<GlossaryImport>;
counts(id: string): Promise<GlossaryCounts>;
export(id: string, contentType: "csv/table-uni", source?: string): Promise<string>;
}