diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-22 10:43:11 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-22 10:43:11 +0200 |
commit | 5c5e587307a27e173333789b5b5167d35f468b01 (patch) | |
tree | 94e3721caf2e11d38fd5f4112c0fc98da89ac535 /server/typings/utils.ts | |
parent | 1b42d73f44811eec1b7ddd72dd0d640a57c3376c (diff) | |
parent | b5fecbf44192144d1ca27c23a0b53922de288c10 (diff) | |
download | PeerTube-5c5e587307a27e173333789b5b5167d35f468b01.tar.gz PeerTube-5c5e587307a27e173333789b5b5167d35f468b01.tar.zst PeerTube-5c5e587307a27e173333789b5b5167d35f468b01.zip |
Merge branch 'feature/strong-model-types' into develop
Diffstat (limited to 'server/typings/utils.ts')
-rw-r--r-- | server/typings/utils.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/server/typings/utils.ts b/server/typings/utils.ts index a86b05be2..4b5cf4d7e 100644 --- a/server/typings/utils.ts +++ b/server/typings/utils.ts | |||
@@ -1,3 +1,13 @@ | |||
1 | export type FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T] | 1 | export type FunctionPropertyNames<T> = { |
2 | [K in keyof T]: T[K] extends Function ? K : never | ||
3 | }[keyof T] | ||
2 | 4 | ||
3 | export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>> | 5 | export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>> |
6 | |||
7 | export type PickWith<T, KT extends keyof T, V> = { | ||
8 | [P in KT]: T[P] extends V ? V : never | ||
9 | } | ||
10 | |||
11 | export type PickWithOpt<T, KT extends keyof T, V> = { | ||
12 | [P in KT]?: T[P] extends V ? V : never | ||
13 | } | ||