UNPKG

molstar

Version:

A comprehensive macromolecular library.

71 lines (70 loc) 2.21 kB
/** * Copyright (c) 2017-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ export interface Database { tables: { [tableName: string]: Table; }; aliases: { [path: string]: string[]; }; } export interface Table { description: string; key: Set<string>; columns: { [columnName: string]: Column; }; } export declare type Column = IntCol | StrCol | FloatCol | CoordCol | EnumCol | VectorCol | MatrixCol | ListCol; declare type BaseCol = { description: string; }; export declare type IntCol = { type: 'int'; } & BaseCol; export declare function IntCol(description: string): IntCol; export declare type StrCol = { type: 'str'; } & BaseCol; export declare function StrCol(description: string): StrCol; export declare type FloatCol = { type: 'float'; } & BaseCol; export declare function FloatCol(description: string): FloatCol; export declare type CoordCol = { type: 'coord'; } & BaseCol; export declare function CoordCol(description: string): CoordCol; export declare type EnumCol = { type: 'enum'; subType: 'int' | 'str'; values: string[]; } & BaseCol; export declare function EnumCol(values: string[], subType: 'int' | 'str', description: string): EnumCol; export declare type VectorCol = { type: 'vector'; length: number; } & BaseCol; export declare function VectorCol(length: number, description: string): VectorCol; export declare type MatrixCol = { type: 'matrix'; rows: number; columns: number; } & BaseCol; export declare function MatrixCol(columns: number, rows: number, description: string): MatrixCol; export declare type ListCol = { type: 'list'; subType: 'int' | 'str' | 'float' | 'coord'; separator: string; } & BaseCol; export declare function ListCol(subType: 'int' | 'str' | 'float' | 'coord', separator: string, description: string): ListCol; export declare type Filter = { [table: string]: { [column: string]: true; }; }; export declare function mergeFilters(...filters: Filter[]): Filter; export {};