@aws-amplify/data-schema-types
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -456,2 +456,24 @@ import { DeepReadOnlyObject, UnwrapArray, UnionToIntersection, Prettify, Equal } from '../util'; | ||
/** | ||
* The utility type that is used to infer the type (interface) of the generated | ||
* `client.enums` property. | ||
* | ||
* @example | ||
* // The schema: | ||
* { | ||
* TodoStatus: a.enum(['Planned' | 'InProgress' | 'Completed']), | ||
* } | ||
* | ||
* // The inferred interface of the `client.enums`: | ||
* { | ||
* TodoStatus: { | ||
* values: () => Array<'Planned' | 'InProgress' | 'Completed'>; | ||
* } | ||
* } | ||
*/ | ||
export type EnumTypes<Schema extends Record<any, any>, ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>> = { | ||
[EnumName in keyof ModelMeta['enums']]: { | ||
values: () => Array<ModelMeta['enums'][EnumName]>; | ||
}; | ||
}; | ||
/** | ||
* Request options that are passed to custom header functions. | ||
@@ -458,0 +480,0 @@ * `method` and `headers` are not included in custom header functions passed to |
{ | ||
"name": "@aws-amplify/data-schema-types", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./lib-esm/index.d.ts", |
@@ -720,2 +720,28 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
/** | ||
* The utility type that is used to infer the type (interface) of the generated | ||
* `client.enums` property. | ||
* | ||
* @example | ||
* // The schema: | ||
* { | ||
* TodoStatus: a.enum(['Planned' | 'InProgress' | 'Completed']), | ||
* } | ||
* | ||
* // The inferred interface of the `client.enums`: | ||
* { | ||
* TodoStatus: { | ||
* values: () => Array<'Planned' | 'InProgress' | 'Completed'>; | ||
* } | ||
* } | ||
*/ | ||
export type EnumTypes< | ||
Schema extends Record<any, any>, | ||
ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>, | ||
> = { | ||
[EnumName in keyof ModelMeta['enums']]: { | ||
values: () => Array<ModelMeta['enums'][EnumName]>; | ||
}; | ||
}; | ||
/** | ||
* Request options that are passed to custom header functions. | ||
@@ -722,0 +748,0 @@ * `method` and `headers` are not included in custom header functions passed to |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65663
1517