mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 18:26:00 +00:00
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
export interface PerspectiveConfigColumns {
|
|
expandedColumns: string[];
|
|
checkedColumns: string[];
|
|
uncheckedColumns: string[];
|
|
}
|
|
|
|
export interface PerspectiveCustomJoinConfig {
|
|
joinid: string;
|
|
joinName: string;
|
|
baseUniqueName: string;
|
|
conid?: string;
|
|
database?: string;
|
|
refSchemaName?: string;
|
|
refTableName: string;
|
|
columns: {
|
|
baseColumnName: string;
|
|
refColumnName: string;
|
|
}[];
|
|
}
|
|
export interface PerspectiveConfig extends PerspectiveConfigColumns {
|
|
filters: { [uniqueName: string]: string };
|
|
sort: {
|
|
[parentUniqueName: string]: {
|
|
uniqueName: string;
|
|
order: 'ASC' | 'DESC';
|
|
}[];
|
|
};
|
|
customJoins: PerspectiveCustomJoinConfig[];
|
|
}
|
|
|
|
export function createPerspectiveConfig(): PerspectiveConfig {
|
|
return {
|
|
expandedColumns: [],
|
|
checkedColumns: [],
|
|
uncheckedColumns: [],
|
|
customJoins: [],
|
|
filters: {},
|
|
sort: {},
|
|
};
|
|
}
|
|
|
|
export type ChangePerspectiveConfigFunc = (
|
|
changeFunc: (config: PerspectiveConfig) => PerspectiveConfig,
|
|
reload?: boolean
|
|
) => void;
|