-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e00699
commit c5c6fc3
Showing
9 changed files
with
103 additions
and
75 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
4 changes: 2 additions & 2 deletions
4
src/services/user-preferences/models/definitions/user-preference-definition.ts
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,7 +1,7 @@ | ||
import { type UserPreferenceScopeType } from './user-preference-scope-type' | ||
|
||
export interface UserPreferenceDefinition { | ||
export interface UserPreferenceDefinition<T> { | ||
isOptedInByDefault: boolean | ||
allowedScope: UserPreferenceScopeType | ||
defaultData: any | ||
defaultData: T | ||
} |
4 changes: 2 additions & 2 deletions
4
src/services/user-preferences/models/definitions/user-preference-definitions.ts
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,5 @@ | ||
import { type UserPreferenceDefinition } from './user-preference-definition' | ||
|
||
export type UserPreferenceDefinitions<UserPreferenceId extends PropertyKey> = { | ||
[Id in UserPreferenceId]?: UserPreferenceDefinition | ||
export type UserPreferenceDefinitions<UserPreferenceId extends PropertyKey, T> = { | ||
[Id in UserPreferenceId]?: UserPreferenceDefinition<T> | ||
} |
4 changes: 2 additions & 2 deletions
4
src/services/user-preferences/models/storage-models/user-preference.ts
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 @@ | ||
export interface UserPreference { | ||
export interface UserPreference<T> { | ||
optedIn: boolean | ||
data?: any | ||
data?: T | ||
} |
4 changes: 2 additions & 2 deletions
4
src/services/user-preferences/models/storage-models/user-preferences.ts
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,6 +1,6 @@ | ||
import { type UserPreferenceScope } from './user-preference-scope' | ||
import { type UserPreference } from './user-preference' | ||
|
||
export type UserPreferences<UserPreferenceId extends PropertyKey> = { | ||
[K in UserPreferenceScope]?: { [Id in UserPreferenceId]: UserPreference } | ||
export type UserPreferences<UserPreferenceId extends PropertyKey, T> = { | ||
[K in UserPreferenceScope]?: { [Id in UserPreferenceId]: UserPreference<T> } | ||
} |
4 changes: 2 additions & 2 deletions
4
src/services/user-preferences/models/user-preferences/composite-user-preferences.ts
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,5 @@ | ||
import { type UserPreference } from '../storage-models/user-preference' | ||
|
||
export type CompositeUserPreferences<UserPreferenceId extends PropertyKey> = { | ||
[Id in UserPreferenceId]: UserPreference | ||
export type CompositeUserPreferences<UserPreferenceId extends PropertyKey, T> = { | ||
[Id in UserPreferenceId]: UserPreference<T> | ||
} |
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.