dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
19 lines (18 loc) • 904 B
TypeScript
import type { MapSchema } from '../../../../schema/index.js';
import type { ComputeObject } from '../../../../types/computeObject.js';
import type { OmitKeys } from '../../../../types/omitKeys.js';
import type { FormattedValueJSONSchema } from './schema.js';
import type { RequiredProperties } from './shared.js';
export type FormattedMapJSONSchema<SCHEMA extends MapSchema, REQUIRED_PROPERTIES extends string = RequiredProperties<SCHEMA>> = ComputeObject<{
type: 'object';
properties: {
[KEY in OmitKeys<SCHEMA['attributes'], {
props: {
hidden: true;
};
}>]: FormattedValueJSONSchema<SCHEMA['attributes'][KEY]>;
};
} & ([REQUIRED_PROPERTIES] extends [never] ? {} : {
required: REQUIRED_PROPERTIES[];
})>;
export declare const getFormattedMapJSONSchema: <SCHEMA extends MapSchema>(schema: SCHEMA) => FormattedMapJSONSchema<SCHEMA>;