From 453e83ea5d81d203ba34bc43cd5c2c750ba40568 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Aug 2019 11:53:26 +0200 Subject: Stronger model typings --- server/typings/utils.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'server/typings/utils.ts') diff --git a/server/typings/utils.ts b/server/typings/utils.ts index a86b05be2..ed0fca3d1 100644 --- a/server/typings/utils.ts +++ b/server/typings/utils.ts @@ -1,3 +1,15 @@ -export type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T] +export type FunctionPropertyNames = { + [K in keyof T]: T[K] extends Function ? K : never +}[keyof T] export type FunctionProperties = Pick> + +export type ValueOf = T[KT] + +export type PickWith = { + [P in KT]: T[P] extends V ? V : never +} + +export type PickWithOpt = { + [P in KT]?: T[P] extends V ? V : never +} -- cgit v1.2.3 From 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Aug 2019 19:05:31 +0200 Subject: Type toFormattedJSON --- server/typings/utils.ts | 2 -- 1 file changed, 2 deletions(-) (limited to 'server/typings/utils.ts') diff --git a/server/typings/utils.ts b/server/typings/utils.ts index ed0fca3d1..4b5cf4d7e 100644 --- a/server/typings/utils.ts +++ b/server/typings/utils.ts @@ -4,8 +4,6 @@ export type FunctionPropertyNames = { export type FunctionProperties = Pick> -export type ValueOf = T[KT] - export type PickWith = { [P in KT]: T[P] extends V ? V : never } -- cgit v1.2.3