Skip to content

Commit

Permalink
feat(types): use literalunion in list
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Oct 21, 2023
1 parent 565081f commit 21d7443
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.21)
project(venmic LANGUAGES CXX VERSION 1.3)
project(venmic LANGUAGES CXX VERSION 1.4)

# --------------------------------------------------------------------------------------------------------
# Library options
Expand Down
7 changes: 6 additions & 1 deletion lib/module.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
type DefaultProps = 'node.name' | 'application.name';

type LiteralUnion<
LiteralType,
BaseType extends string,
> = LiteralType | (BaseType & Record<never, never>);

export class PatchBay
{
unlink(): void;

list<T extends string = DefaultProps>(props?: T[]): Record<T, string>[];
list<T extends string = DefaultProps>(props?: T[]): Record<LiteralUnion<T, string>, string>[];
link(data: {key: string, value: string, mode: "include" | "exclude"}): boolean;

static hasPipeWire(): boolean;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Curve",
"url": "https://github.com/Curve"
},
"version": "1.3.0",
"version": "1.4.0",
"main": "./lib/index.js",
"types": "./lib/module.d.ts",
"scripts": {
Expand Down

0 comments on commit 21d7443

Please sign in to comment.