Skip to content

Commit

Permalink
refactor: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Jan 6, 2024
1 parent ad1d9ea commit 1165b08
Show file tree
Hide file tree
Showing 3 changed files with 17 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 3.2.1)
project(venmic LANGUAGES CXX VERSION 3.2.2)

# --------------------------------------------------------------------------------------------------------
# Library options
Expand Down
16 changes: 15 additions & 1 deletion lib/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,32 @@ type LiteralUnion<
BaseType extends string,
> = LiteralType | (BaseType & Record<never, never>);

type Optional<
Type,
Key extends keyof Type
> = Partial<Pick<Type, Key>> & Omit<Type, Key>;

export interface Prop
{
key: string;
value: string;
}

export interface LinkData
{
include: Prop[];
exclude: Prop[];

ignore_devices?: boolean;
}


export class PatchBay
{
unlink(): void;

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

static hasPipeWire(): boolean;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"private": false,
"license": "MIT",
"author": "Curve (https://github.com/Curve)",
"version": "3.2.1",
"version": "3.2.2",
"main": "./lib/index.js",
"types": "./lib/module.d.ts",
"scripts": {
Expand Down

0 comments on commit 1165b08

Please sign in to comment.