import { Env } from "@tsplus/stdlib/service/Env" /** * @tsplus type Tag.Ops */ export interface TagOps { readonly sym: unique symbol readonly is: (u: unknown) => u is Tag (): Tag } export const Tag: TagOps = Object.assign( (): Tag => ({ [Tag.sym]: identity, toEnv(value) { return Env(this, value) }, [Equals.sym](that) { return this === that }, [Hash.sym]() { return Hash.randomCached(this) } }), { sym: Symbol("@tsplus/stdlib/environment/Tag") as TagOps["sym"], is: (u: unknown): u is Tag => typeof u === "object" && u != null && Tag.sym in u } ) /** * @tsplus type Tag */ export interface Tag extends Equals { readonly [Tag.sym]: (_: S) => S toEnv(value: S): Service.Env } export declare namespace Tag { type TagType> = T extends Tag ? A : never }