Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Better Type Annotations for Realtime Subscriptions #212

Description

@Marviel

Proposed type addition mockup:

export type ColNames = "name" | "type" | "unit" | "value" | "description";
export type FilterOps = "eq" | "ne" | "gt" | "lt" | "ge" | "le";
export type FilterType = `${ColNames}.${FilterOps}=${string}`;

// works!
const works1: FilterType = "name.eq=hello";
// typeerror (non existent column)
const fails1: FilterType = "name.eq=non-existent-column";
// typeerror (bad syntax)
const fails2: FilterType = "name.eq!!!hello";

It would be nice if the realtime subscription string type could be updated to reflect this.

I would submit a full PR except that I think this has implications for some other template types, which I don't have the personal time to dig into right now.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions