Skip to content

Commit

Permalink
#14 #88 Add discriminator for Palette interface
Browse files Browse the repository at this point in the history
  • Loading branch information
azurepolarbear committed Jun 2, 2024
1 parent 723b5b6 commit 2ff7598
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion docs/release-notes/v0.6.0-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ declare interface Palette {
'#000000': string[],
'#FFFFFF': string[],
[HEX: string]: string[]
}
},

/**
* Discriminator for determining if an object is a Palette.
*/
readonly DISCRIMINATOR: Discriminators.PALETTE;
}
```

Expand Down
11 changes: 9 additions & 2 deletions src/main/color/palette/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
* See the GNU Affero General Public License for more details.
*/

import {PaletteColor} from "./palette-color";
import {Discriminators} from 'discriminator';

import {PaletteColor} from './palette-color';

/**
* A collection of {@link PaletteColor} objects.
Expand Down Expand Up @@ -53,5 +55,10 @@ export interface Palette {
'#000000': string[],
'#FFFFFF': string[],
[HEX: string]: string[]
}
},

/**
* Discriminator for determining if an object is a Palette.
*/
readonly DISCRIMINATOR: Discriminators.PALETTE;
}

0 comments on commit 2ff7598

Please sign in to comment.