diff --git a/src/Metrics.d.ts b/src/Metrics.d.ts new file mode 100644 index 0000000..6242d88 --- /dev/null +++ b/src/Metrics.d.ts @@ -0,0 +1,24 @@ +export class Metrics { + constructor(table: any, params?: {}, prior?: {}); + table: any; + log: any; + metrics: { + chan: string; + dimensions: string[]; + enable: boolean; + env: boolean; + hot: boolean; + max: number; + namespace: string; + period: number; + properties: {}; + queries: boolean; + source: string; + tenant: any; + }; + add(model: any, op: any, result: any, params: any, mark: any): void; + addMetricGroup(values: any, dimensionValues: any, properties: any): void; + addMetric(key: any, values: any, dimensions: any, dimensionValues: any, properties: any): void; + flushMetrics(timestamp?: number): void; + emitMetrics(timestamp: any, rec: any): void; +} diff --git a/src/Model.d.ts b/src/Model.d.ts index 221c928..d56b922 100644 --- a/src/Model.d.ts +++ b/src/Model.d.ts @@ -280,6 +280,7 @@ export type OneParams = { type?: string tunnel?: object where?: string + profile?: string } /* diff --git a/src/Table.d.ts b/src/Table.d.ts index 96180b0..2dc84b5 100644 --- a/src/Table.d.ts +++ b/src/Table.d.ts @@ -14,6 +14,7 @@ import { Paged, Entity, } from './Model' +import { Metrics } from './Metrics' import {DynamoDBRecord} from 'aws-lambda' export type EntityGroup = { @@ -78,6 +79,7 @@ type ExtractModel = M extends Entity ? X : never export class Table { name: string + metrics: Metrics constructor(params: TableConstructorParams) addContext(context?: {}): Table @@ -97,7 +99,7 @@ export class Table { getKeys(): Promise getModel( name: T extends ModelNames ? T : ModelNames, - options?: {nothrow: boolean} + options?: {nothrow?: boolean} ): T extends string ? Model> : Model>> getCurrentSchema(): {} groupByType(items: AnyEntity[], params?: OneParams): EntityGroup