azure-kusto-data
Version:
Azure Data Explorer Query SDK
83 lines • 2.52 kB
TypeScript
export declare enum WellKnownDataSet {
PrimaryResult = "PrimaryResult",
QueryCompletionInformation = "QueryCompletionInformation",
TableOfContents = "TableOfContents",
QueryProperties = "QueryProperties"
}
type DateTimeParser = (value: string | null) => any;
type TimeSpanParser = (value: string | null) => any;
export interface Table {
TableKind?: string;
TableName: string;
TableId?: number;
Columns: Column[];
Rows: any[][];
}
interface Column {
ColumnName: string;
ColumnType?: string;
DateType?: string;
}
/**
* Represents a Kusto result row.
* Use `dateTimeParser` and `timeSpanParser` to customize the parsing of the `datetime` and `timespan` types.
* By default, `datetime` is parsed to a `Date` object and `timespan` is parsed to a number representing the number of milliseconds, as returned by subtracting two `Date` objects.
*/
export declare class KustoResultRow {
columns: KustoResultColumn[];
raw: {
[ord: number]: any;
};
[column: string]: any;
constructor(columns: KustoResultColumn[], row: {
[ord: number]: any;
}, dateTimeParser?: DateTimeParser, timeSpanParser?: TimeSpanParser);
values(): Generator<any, void, unknown>;
getValueAt(index: number): any;
/**
* @deprecated use the compliant toJSON() instead
*/
toJson(): Record<string, any>;
toJSON<T = Record<string, any>>(): T;
toString(): string;
}
export declare class KustoResultColumn {
name: string | null;
type: string | null;
ordinal: number;
constructor(columnObj: {
ColumnName?: string;
ColumnType?: string;
DateType?: string;
}, ordinal: number);
}
export declare class KustoResultTable {
name: string;
id?: number;
kind?: string;
columns: KustoResultColumn[];
readonly _rows: any[];
private _dateTimeParser;
private _timeSpanParser;
[row: number]: any;
constructor(tableObj: Table);
get timeSpanParser(): TimeSpanParser;
set timeSpanParser(value: TimeSpanParser);
get dateTimeParser(): DateTimeParser;
set dateTimeParser(value: DateTimeParser);
rows(): Generator<KustoResultRow, void, unknown>;
/**
* @deprecated use the compliant toJSON() instead
*/
toJson(): {
name: string;
data: Record<string, any>[];
};
toJSON<T = Record<string, any>>(): {
name: string;
data: T[];
};
toString(): string;
}
export {};
//# sourceMappingURL=models.d.ts.map