From 800af1021c67ffe0ddcaed37ab09179d33102e35 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 10 Oct 2024 15:11:46 +0000 Subject: docs: gobject, variable, binding page --- core/gjs/src/variable.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'core/gjs/src') diff --git a/core/gjs/src/variable.ts b/core/gjs/src/variable.ts index 8739ef6..b61e335 100644 --- a/core/gjs/src/variable.ts +++ b/core/gjs/src/variable.ts @@ -1,6 +1,6 @@ -import Binding, { type Connectable } from "./binding.js" +import Binding, { type Connectable, type Subscribable } from "./binding.js" import { Astal } from "./imports.js" -import { interval, idle } from "./time.js" +import { interval } from "./time.js" import { execAsync, subprocess } from "./process.js" class VariableWrapper extends Function { @@ -200,10 +200,9 @@ class VariableWrapper extends Function { } static derive< - const Deps extends Array | Binding>, + const Deps extends Array>, Args extends { - [K in keyof Deps]: Deps[K] extends Variable - ? T : Deps[K] extends Binding ? T : never + [K in keyof Deps]: Deps[K] extends Subscribable ? T : never }, V = Args, >(deps: Deps, fn: (...args: Args) => V = (...args) => args as unknown as V) { @@ -225,7 +224,7 @@ export const Variable = new Proxy(VariableWrapper as any, { }) as { derive: typeof VariableWrapper["derive"] (init: T): Variable - new (init: T): Variable + new(init: T): Variable } export default Variable -- cgit v1.2.3