@contember/schema-definition
Advanced tools
Comparing version 0.11.0-alpha.4 to 0.11.0-alpha.5
@@ -1,6 +0,6 @@ | ||
declare class EnumDefinition { | ||
readonly values: string[]; | ||
constructor(values: string[]); | ||
declare class EnumDefinition<Values extends string = string> { | ||
readonly values: Values[]; | ||
constructor(values: Values[]); | ||
} | ||
export default EnumDefinition; | ||
//# sourceMappingURL=EnumDefinition.d.ts.map |
@@ -34,3 +34,3 @@ import { Interface } from './types'; | ||
export declare function oneHasOneInversed(target: EntityConstructor, ownedBy: string): OneHasOneInverseDefinition; | ||
export declare function createEnum(...values: string[]): EnumDefinition; | ||
export declare function createEnum<Values extends string>(...values: Values[]): EnumDefinition<Values>; | ||
declare type UniqueOptions<T> = { | ||
@@ -37,0 +37,0 @@ name?: string; |
{ | ||
"name": "@contember/schema-definition", | ||
"version": "0.11.0-alpha.4", | ||
"version": "0.11.0-alpha.5", | ||
"license": "Apache-2.0", | ||
@@ -11,4 +11,4 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@contember/schema": "^0.11.0-alpha.4", | ||
"@contember/schema-utils": "^0.11.0-alpha.4", | ||
"@contember/schema": "^0.11.0-alpha.5", | ||
"@contember/schema-utils": "^0.11.0-alpha.5", | ||
"reflect-metadata": "^0.1.13" | ||
@@ -15,0 +15,0 @@ }, |
@@ -1,5 +0,5 @@ | ||
class EnumDefinition { | ||
constructor(public readonly values: string[]) {} | ||
class EnumDefinition<Values extends string = string> { | ||
constructor(public readonly values: Values[]) {} | ||
} | ||
export default EnumDefinition |
@@ -88,4 +88,4 @@ import { Interface } from './types' | ||
export function createEnum(...values: string[]) { | ||
return new EnumDefinition(values) | ||
export function createEnum<Values extends string>(...values: Values[]): EnumDefinition<Values> { | ||
return new EnumDefinition<Values>(values) | ||
} | ||
@@ -92,0 +92,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
562624