-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up environment of SDK to work with creted type system
- Loading branch information
Showing
12 changed files
with
2,417 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
import { Currency } from './Currency' | ||
import { Locale } from './Locale' | ||
import { BearerToken, OrderToken } from './Token' | ||
|
||
export type ClientBuilderOptions = Partial<{ | ||
order_token: OrderToken | ||
bearer_token: BearerToken | ||
locale: Locale | ||
currency: Currency | ||
order_token: string | ||
bearer_token: string | ||
locale: string | ||
currency: string | ||
}> | ||
|
||
export type AllowedClientBuilderOptions = { | ||
[K in keyof Required<ClientBuilderOptions>]: boolean | ||
[K in keyof ClientBuilderOptions]-?: boolean | ||
} | ||
|
||
export type DefaultBuilderOptions = AllowedClientBuilderOptions & { [K in keyof AllowedClientBuilderOptions]: false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Transforms given Union of T keys into partial | ||
*/ | ||
export type MakeOptional<T, Union extends keyof T> = Omit<T, Union> & Partial<Pick<T, Union>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Transforms given Union of T keys into required | ||
*/ | ||
export type MakeRequired<T, Union extends keyof T> = Omit<T, Union> & Required<Pick<T, Union>> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
* Sets a property with key {@link Key} of type {@link Type} to value {@link Value} | ||
* Sets a property with key {@link Key} to value {@link Value} on type {@link Type} | ||
*/ | ||
export type SetProperty<Type, Key extends keyof Type, Value> = Omit<Type, Key> & Record<Key, Value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.