-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: separation between SimplePicker and WeightPicker. Add filters
- Loading branch information
Showing
52 changed files
with
2,038 additions
and
841 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
Submodule rand-picker.wiki
added at
0c3ae9
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,6 @@ | ||
import { PickOptions } from "./PickOptions"; | ||
|
||
export interface CanPick<T> { | ||
pickOne(options?: PickOptions<T>): T | undefined; | ||
pick(n: number, options?: PickOptions<T>): 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Filter } from "./filters"; | ||
|
||
export interface CanRemove<T> { | ||
remove(obj: T): T | undefined; | ||
clear(): void; | ||
filter(...filters: Filter<T>[]): T[]; | ||
} |
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,9 +1,12 @@ | ||
export type PickOptions = { | ||
import { Filter } from "./filters"; | ||
|
||
export type PickOptions<T> = { | ||
unique?: boolean; | ||
sequential?: boolean; | ||
filters?: Filter<T>[]; | ||
}; | ||
|
||
export const DefaultPickOptions: PickOptions = { | ||
export const DefaultPickOptions: PickOptions<unknown> = { | ||
unique: false, | ||
sequential: false, | ||
}; |
Oops, something went wrong.