Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

enum extends dictionary c#

type EnumDictionary<T extends string | symbol | number, U> = {
    [K in T]: U;
};

enum Direction {
    Up,
    Down,
}

const a: EnumDictionary<Direction, number> = {
    [Direction.Up]: 1,
    [Direction.Down]: -1
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #enum #extends #dictionary
ADD COMMENT
Topic
Name
8+2 =