declare namespace API { type Label = { id: number; labelKey: string; parentId: number; name: string; type: number; mappingFlag: number; }; type RelatedMetric = { id: number; metricName: string; alias: string; aliasEn: string; metricCategoryId: number; mark: number; }; type RelatedRecord = { id: number; entityNameZh: string; entityNameEn: string; type: number; url: string; }; type RelatedEntity = { id: number; entityNameZh: string; entityNameEn: string; type: number; url: string; }; type Mark = { id: number; name: string; targetType: string; mark: number; metricKey: string; }; type Module = { moduleId: number; moduleName: string; count: number; metrics: Metric[]; children: Module[]; levelCode: string; }; export type MetricTree = { marks: Mark[]; metrics: Module[]; }; type MetricCare = { metricId: string; status: number; }; type getMetricDetailParams = { metricId: number; }; type MetricAttribute = { attributeId: number; attributeKey: string; alias: string; nameEn: string; attributeType: number; highCardinality: number; }; type Metric = { id: number; mark: number; isMetric?: boolean; metricName: string; formula: string; originMetricName: string; alias: string; aliasEn: string; description: string; preference: string; metricSource: string; metricType: string; lastSeenTime: number; unit: string; aggrFunction?: string; formulaEn: string; dimensions: MetricAttribute[][]; dataPointType: string; metricLevel: string; collectFrequency: string; upperBound: number; lowerBound: number; relatedMetrics: RelatedMetric[]; }; type getMetricQueryResultParams = { duration: number; end: number; timeNum: number; timeUnit: string; dataModel: string; // datasetNames?: string[]; /** 查询场景:1--时序数据查询;10--聚合数据查询;11--时序,聚合都查询,默认为11 */ queryCase?: number; query: { identifier: string; select: API.QueryParamSelect[]; where?: { condition: { k: string; op: string; v?: string; t: string; }[]; logical: string; where?: any; // This is recursive and should be replaced with the correct type }; groupBy?: { k: string; t: string; }[]; having?: { condition: { fn: string; op: string; v: string; }[][]; logical: string; having?: any; // This is recursive and should be replaced with the correct type }; orderBy?: { fn: string; od: string; }[]; limit?: number; fx?: { k: string; }; duration?: number; endTime?: number; }[]; postEx?: { identifier: string; k: string; fx?: { k: string; }; }[]; /** nbql 的值 */ nbql?: string; }; type Header = { name: string; alias: null; unit: null; type: string; identifier?: string; }; type MetricResultData = { header: Header[]; result: Record[]; series: Record[]; }; type WhereCondition = { conAttr: string; conOperator: string; conValue: string; }; type getMetricEditDataParams = { metricId: number; }; type createMetricParams = { id: number; metricName: string; alias: string; metricCategoryId: number; preference: 0 | 1 | 2; unit: string; description: string; datasetNames: string[]; sourceModelType: 0 | 1 | 2; aggrConditionType: 1 | 2; aggrAttribute: string; selectAggrFunction: string; where: WhereCondition[]; groupBy: string[]; collectFrequency: number; lowerBound: number | null; upperBound: number | null; metricLevel: number; compositeJson?: string; }; type createCompositeMetricParams = { id: number; metricName: string; alias: string; metricCategoryId: number; preference: 0 | 1 | 2; unit: string; description: string; groupBy: string[]; collectFrequency: number; lowerBound: number | null; upperBound: number | null; metricLevel: number; compositeJson: string; }; type compositeMetric = { var: string; selectMetric: number; aggrFunction: string; where: WhereCondition[]; }; type composite = { expr: string; metrics: compositeMetric[]; info: metricInfo[]; groupByValue: API.QueryParamGroupBy[]; }; type metricInfo = { identifier: string; attributeList?: API.MetricAttribute[]; selectValue: API.QueryParamSelect[]; whereValue: API.QueryParamWhere[]; }; }