-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Add some more exports for use in the other packages
- Loading branch information
Showing
6 changed files
with
63 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@blizzard-api/core': patch | ||
--- | ||
|
||
Add BlizzardNamespaces, ClientOptions, Resource, ResourceResponse, ResourceOptions, ResourceInterface,ProtectedResourceOptions and ProtectedResourceInterface exports. |
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,5 +1,19 @@ | ||
//Resource | ||
export type { BlizzardNamespaces } from './resource.js'; | ||
//Endpoint | ||
export type { Origins, Locales } from './endpoint.js'; | ||
export { getEndpoint } from './endpoint.js'; | ||
|
||
//Namespace | ||
export type { BlizzardNamespaces } from './namespace.js'; | ||
|
||
//Request | ||
export type { ClientOptions } from './request.js'; | ||
|
||
//Resource | ||
export type { | ||
Resource, | ||
ResourceResponse, | ||
ResourceOptions, | ||
ResourceInterface, | ||
ProtectedResourceOptions, | ||
ProtectedResourceInterface, | ||
} from './resource.js'; |
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,8 @@ | ||
export type BlizzardNamespaces = | ||
| 'profile' | ||
| 'static' | ||
| 'dynamic' | ||
| 'static-classic' | ||
| 'dynamic-classic' | ||
| 'static-classic1x' | ||
| 'dynamic-classic1x'; |
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,9 @@ | ||
import type { Locales, Origins } from './endpoint'; | ||
|
||
export interface ClientOptions { | ||
key: string; | ||
secret: string; | ||
origin: Origins; | ||
locale?: Locales; | ||
token?: string; | ||
} |
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,8 +1,17 @@ | ||
export type BlizzardNamespaces = | ||
| 'profile' | ||
| 'static' | ||
| 'dynamic' | ||
| 'static-classic' | ||
| 'dynamic-classic' | ||
| 'static-classic1x' | ||
| 'dynamic-classic1x'; | ||
import type { BlizzardNamespaces } from './namespace'; | ||
import type { ClientOptions } from './request'; | ||
|
||
export interface Resource<T = never> { | ||
path: string; | ||
namespace?: BlizzardNamespaces; | ||
params?: T; | ||
} | ||
export type ResourceResponse<T = unknown> = Promise<T>; | ||
|
||
export type ResourceOptions<T> = Partial<ClientOptions> & T; | ||
export type ResourceInterface<T = unknown, P = unknown> = (options: ResourceOptions<T>) => Resource<P>; | ||
|
||
export type ProtectedResourceOptions<T> = Partial<ClientOptions> & { token: string } & T; | ||
export type ProtectedResourceInterface<T = unknown, P = unknown> = ( | ||
options: ProtectedResourceOptions<T>, | ||
) => Resource<P>; |