{
  "id": "@typed/id#CuidState",
  "canonicalId": "@typed/id#CuidState",
  "symbol": {
    "id": "@typed/id#CuidState",
    "packageName": "@typed/id",
    "moduleName": ".",
    "exportName": "CuidState",
    "kind": "class",
    "signatures": [
      "export declare class CuidState extends CuidState_base {\n    static readonly next: Effect.Effect<{\n        timestamp: number;\n        counter: number;\n        random: Uint8Array<ArrayBufferLike> & {\n            readonly length: 32;\n        };\n        fingerprint: string;\n    }, never, CuidState>;\n    static readonly Default: Layer.Layer<CuidState, never, never>;\n}"
    ],
    "summary": "Process-local Effect service that supplies sequential CUID seeds.",
    "sections": {
      "Why": "Counter state and caller-provided `envData` live in an explicit service so tests and applications choose the sharing boundary instead of relying on hidden globals.",
      "Ownership and lifetime": "Each Layer instance owns its mutable counter and captured fingerprint. A new process, worker, or Layer resets that sequence; exact SSR identity must be serialized and reused.",
      "Property: Default": "Provides a default CuidState backed by system time and Web Crypto entropy.",
      "Property: Default: Why": "The explicit Layer gives production code a standard service while keeping test and environment-specific alternatives replaceable.",
      "Property: Default: Ownership and lifetime": "Layer acquisition creates one counter state; the surrounding Layer Scope owns it. Web Crypto must be available in the runtime.",
      "Property: next": "Reads one seed from the current CuidState service.",
      "Property: next: Why": "The accessor exposes stateful sequencing through Effect's service channel rather than a module-global counter.",
      "Property: next: Ownership and lifetime": "The Effect requires `CuidState`; its Layer owns the counter for the Layer lifetime."
    },
    "examples": [
      {
        "language": "text",
        "code": "```ts\nimport { cuid, CuidState } from \"@typed/id/Cuid\"\nimport { Effect } from \"effect\"\nconst program = Effect.provide(cuid, CuidState.Default)\n```\nSee [Effect services](https://effect.website/docs/requirements-management/services/) and [Layers](https://effect.website/docs/requirements-management/layers/)."
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/id/src/Cuid.ts",
      "line": 97
    },
    "since": "1.0.0",
    "category": "Sequence state"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/id#CuidState",
    "packageName": "@typed/id",
    "packageVersion": "1.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/id",
    "exportName": "CuidState",
    "qualifiedName": "CuidState",
    "declarationKey": "declaration:0ae7f9c7cf8202687a91df4d",
    "family": "class",
    "signatures": [
      "export declare class CuidState extends CuidState_base {\n    static readonly next: Effect.Effect<{\n        timestamp: number;\n        counter: number;\n        random: Uint8Array<ArrayBufferLike> & {\n            readonly length: 32;\n        };\n        fingerprint: string;\n    }, never, CuidState>;\n    static readonly Default: Layer.Layer<CuidState, never, never>;\n}"
    ],
    "sourceSpans": [
      {
        "file": "packages/id/src/Cuid.ts",
        "start": {
          "line": 97,
          "column": 1
        },
        "end": {
          "line": 158,
          "column": 2
        }
      },
      {
        "file": "packages/id/src/Cuid.ts",
        "start": {
          "line": 155,
          "column": 3
        },
        "end": {
          "line": 157,
          "column": 5
        }
      },
      {
        "file": "packages/id/src/Cuid.ts",
        "start": {
          "line": 140,
          "column": 3
        },
        "end": {
          "line": 143,
          "column": 6
        }
      }
    ],
    "aliases": [
      "@typed/id/Cuid#CuidState"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:0ae7f9c7cf8202687a91df4d",
    "name": "CuidState",
    "family": "class",
    "facets": [
      {
        "family": "class",
        "syntaxKind": "ClassDeclaration",
        "signatures": [
          "export declare class CuidState extends CuidState_base {\n    static readonly next: Effect.Effect<{\n        timestamp: number;\n        counter: number;\n        random: Uint8Array<ArrayBufferLike> & {\n            readonly length: 32;\n        };\n        fingerprint: string;\n    }, never, CuidState>;\n    static readonly Default: Layer.Layer<CuidState, never, never>;\n}"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/id/src/Cuid.ts",
            "start": {
              "line": 97,
              "column": 1
            },
            "end": {
              "line": 158,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertyDeclaration",
        "signatures": [
          "static readonly Default: Layer.Layer<CuidState, never, never>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/id/src/Cuid.ts",
            "start": {
              "line": 155,
              "column": 3
            },
            "end": {
              "line": 157,
              "column": 5
            }
          }
        ],
        "static": true,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertyDeclaration",
        "signatures": [
          "static readonly next: Effect.Effect<{\n    timestamp: number;\n    counter: number;\n    random: Uint8Array<ArrayBufferLike> & {\n        readonly length: 32;\n    };\n    fingerprint: string;\n}, never, CuidState>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/id/src/Cuid.ts",
            "start": {
              "line": 140,
              "column": 3
            },
            "end": {
              "line": 143,
              "column": 6
            }
          }
        ],
        "static": true,
        "readonly": true,
        "optional": false
      }
    ],
    "signatures": [
      "export declare class CuidState extends CuidState_base {\n    static readonly next: Effect.Effect<{\n        timestamp: number;\n        counter: number;\n        random: Uint8Array<ArrayBufferLike> & {\n            readonly length: 32;\n        };\n        fingerprint: string;\n    }, never, CuidState>;\n    static readonly Default: Layer.Layer<CuidState, never, never>;\n}"
    ],
    "typeParameters": [],
    "summary": "Process-local Effect service that supplies sequential CUID seeds.",
    "sections": {
      "Why": "Counter state and caller-provided `envData` live in an explicit service so tests and applications choose the sharing boundary instead of relying on hidden globals.",
      "Ownership and lifetime": "Each Layer instance owns its mutable counter and captured fingerprint. A new process, worker, or Layer resets that sequence; exact SSR identity must be serialized and reused.",
      "Property: Default": "Provides a default CuidState backed by system time and Web Crypto entropy.",
      "Property: Default: Why": "The explicit Layer gives production code a standard service while keeping test and environment-specific alternatives replaceable.",
      "Property: Default: Ownership and lifetime": "Layer acquisition creates one counter state; the surrounding Layer Scope owns it. Web Crypto must be available in the runtime.",
      "Property: next": "Reads one seed from the current CuidState service.",
      "Property: next: Why": "The accessor exposes stateful sequencing through Effect's service channel rather than a module-global counter.",
      "Property: next: Ownership and lifetime": "The Effect requires `CuidState`; its Layer owns the counter for the Layer lifetime."
    },
    "examples": [
      {
        "language": "text",
        "code": "```ts\nimport { cuid, CuidState } from \"@typed/id/Cuid\"\nimport { Effect } from \"effect\"\nconst program = Effect.provide(cuid, CuidState.Default)\n```\nSee [Effect services](https://effect.website/docs/requirements-management/services/) and [Layers](https://effect.website/docs/requirements-management/layers/)."
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/id/src/Cuid.ts",
        "start": {
          "line": 97,
          "column": 1
        },
        "end": {
          "line": 158,
          "column": 2
        }
      },
      {
        "file": "packages/id/src/Cuid.ts",
        "start": {
          "line": 155,
          "column": 3
        },
        "end": {
          "line": 157,
          "column": 5
        }
      },
      {
        "file": "packages/id/src/Cuid.ts",
        "start": {
          "line": 140,
          "column": 3
        },
        "end": {
          "line": 143,
          "column": 6
        }
      }
    ],
    "since": "1.0.0",
    "category": "Sequence state"
  }
}
