Skip to content

Commit 46bf068

Browse files
authored
refactor: rename custom type options (#773)
1 parent 5d0d964 commit 46bf068

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ catching typos at compile time.
234234
import { initialize } from 'unleash-client';
235235

236236
declare module 'unleash-client' {
237-
interface CustomTypeOptions {
238-
name: 'aaa' | 'bbb';
237+
interface UnleashTypes {
238+
flagNames: 'aaa' | 'bbb';
239239
}
240240
}
241241

src/client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ interface BooleanMap {
2222
* Users can extend this via module augmentation:
2323
*
2424
* declare module 'unleash-client' {
25-
* interface CustomTypeOptions {
26-
* name: string;
25+
* interface UnleashTypes {
26+
* flagNames: string;
2727
* }
2828
* }
2929
*/
30-
export interface CustomTypeOptions {}
30+
export interface UnleashTypes {}
3131

32-
type GetCustom<K extends PropertyKey, Fallback> = K extends keyof CustomTypeOptions
33-
? CustomTypeOptions[K]
32+
type GetCustom<K extends PropertyKey, Fallback> = K extends keyof UnleashTypes
33+
? UnleashTypes[K]
3434
: Fallback;
35-
export type Name = GetCustom<'name', string>;
35+
export type Name = GetCustom<'flagNames', string>;
3636

3737
export default class UnleashClient extends EventEmitter {
3838
private repository: RepositoryInterface;

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { UnleashEvents } from './events';
77
import { ClientFeaturesResponse } from './feature';
88
import InMemStorageProvider from './repository/storage-provider-in-mem';
99
import { UnleashConfig } from './unleash-config';
10-
import { CustomTypeOptions, Name } from './client';
10+
import { UnleashTypes, Name } from './client';
1111

1212
// exports
1313
export { Strategy } from './strategy/index';
1414
export { Context, Variant, PayloadType, Unleash, TagFilter, InMemStorageProvider, UnleashEvents };
1515
export type { ClientFeaturesResponse, UnleashConfig };
1616
export { UnleashMetricClient } from './impact-metrics/metric-client';
17-
export { CustomTypeOptions, Name };
17+
export { UnleashTypes, Name };
1818

1919
let instance: undefined | Unleash;
2020

0 commit comments

Comments
 (0)