From 21d74433ec519b5c27df20f70dfd7169795ae691 Mon Sep 17 00:00:00 2001 From: Curve Date: Sat, 21 Oct 2023 21:16:10 +0200 Subject: [PATCH] feat(types): use literalunion in `list` --- CMakeLists.txt | 2 +- lib/module.d.ts | 7 ++++++- package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9322d63..85c5b95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/lib/module.d.ts b/lib/module.d.ts index ddd7d9e..a11f0a2 100644 --- a/lib/module.d.ts +++ b/lib/module.d.ts @@ -1,10 +1,15 @@ type DefaultProps = 'node.name' | 'application.name'; +type LiteralUnion< + LiteralType, + BaseType extends string, +> = LiteralType | (BaseType & Record); + export class PatchBay { unlink(): void; - list(props?: T[]): Record[]; + list(props?: T[]): Record, string>[]; link(data: {key: string, value: string, mode: "include" | "exclude"}): boolean; static hasPipeWire(): boolean; diff --git a/package.json b/package.json index 36e9e34..42b470c 100644 --- a/package.json +++ b/package.json @@ -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": {