import { String, ForeignKey, Geo } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand"; import { OneOf } from "oak-domain/lib/types/Polyfill"; import * as SubQuery from "../_SubQuery"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity"; import { ReadOnlyAction } from "oak-domain/lib/actions/action"; import * as Address from "../Address/Schema"; import * as Station from "../Station/Schema"; import * as Subway from "../Subway/Schema"; export declare type OpSchema = EntityShape & { name: String<32>; level: 'province' | 'city' | 'district' | 'street' | 'country'; depth: 0 | 1 | 2 | 3 | 4; parentId?: ForeignKey<"area"> | null; code: String<12>; center: Geo; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { name: String<32>; level: 'province' | 'city' | 'district' | 'street' | 'country'; depth: 0 | 1 | 2 | 3 | 4; parentId?: ForeignKey<"area"> | null; code: String<12>; center: Geo; parent?: Schema | null; address$area?: Array; address$area$$aggr?: AggregationResult; area$parent?: Array; area$parent$$aggr?: AggregationResult; station$area?: Array; station$area$$aggr?: AggregationResult; subway$area?: Array; subway$area$$aggr?: AggregationResult; } & { [A in ExpressionKey]?: any; }; declare type AttrFilter = { id: Q_StringValue | SubQuery.AreaIdSubQuery; $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; name: Q_StringValue; level: Q_EnumValue<'province' | 'city' | 'district' | 'street' | 'country'>; depth: Q_EnumValue<0 | 1 | 2 | 3 | 4>; parentId: Q_StringValue | SubQuery.AreaIdSubQuery; parent: Filter; code: Q_StringValue; }; export declare type Filter = MakeFilter>; export declare type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; name?: number; level?: number; depth?: number; parentId?: number; parent?: Projection; code?: number; center?: number; address$area?: Address.Selection & { $entity: "address"; }; address$area$$aggr?: Address.Aggregation & { $entity: "address"; }; area$parent?: Selection & { $entity: "area"; }; area$parent$$aggr?: Aggregation & { $entity: "area"; }; station$area?: Station.Selection & { $entity: "station"; }; station$area$$aggr?: Station.Aggregation & { $entity: "station"; }; subway$area?: Subway.Selection & { $entity: "subway"; }; subway$area$$aggr?: Subway.Aggregation & { $entity: "subway"; }; } & Partial>; declare type AreaIdProjection = OneOf<{ id: number; parentId: number; }>; export declare type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { name: number; } | { level: number; } | { depth: number; } | { parentId: number; } | { parent: SortAttr; } | { code: number; } | { center: number; } | { [k: string]: any; } | OneOf>; export declare type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export declare type Sorter = SortNode[]; export declare type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export declare type Selection

= Omit, "action">; export declare type Aggregation = DeduceAggregation; export declare type CreateOperationData = FormCreateData> & ({ parentId?: String<64>; }) & { address$area?: OakOperation, Address.Filter> | OakOperation<"create", Omit[]> | Array> | OakOperation, Address.Filter>>; station$area?: OakOperation, Station.Filter> | OakOperation<"create", Omit[]> | Array> | OakOperation, Station.Filter>>; subway$area?: OakOperation, Subway.Filter> | OakOperation<"create", Omit[]> | Array> | OakOperation, Subway.Filter>>; }; export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>; export declare type CreateMultipleOperation = OakOperation<"create", Array>; export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation; export declare type UpdateOperationData = FormUpdateData> & ({ parent?: never; parentId?: String<64> | null; }) & { [k: string]: any; address$area?: Address.UpdateOperation | Address.RemoveOperation | OakOperation<"create", Omit[]> | Array> | Address.UpdateOperation | Address.RemoveOperation>; station$area?: Station.UpdateOperation | Station.RemoveOperation | OakOperation<"create", Omit[]> | Array> | Station.UpdateOperation | Station.RemoveOperation>; subway$area?: Subway.UpdateOperation | Subway.RemoveOperation | OakOperation<"create", Omit[]> | Array> | Subway.UpdateOperation | Subway.RemoveOperation>; }; export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; export declare type RemoveOperationData = {}; export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation; export declare type AreaIdSubQuery = Selection; export declare type EntityDef = { Schema: Schema; OpSchema: OpSchema; Action: OakMakeAction | string; Selection: Selection; Aggregation: Aggregation; Operation: Operation; Create: CreateOperation; Update: UpdateOperation; Remove: RemoveOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; }; export {};