{
  "id": "@typed/fx#RefSubject.RefSubject.Service",
  "canonicalId": "@typed/fx/RefSubject#RefSubject.Service",
  "symbol": {
    "id": "@typed/fx#RefSubject.RefSubject.Service",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.RefSubject.Service",
    "kind": "interface",
    "signatures": [
      "interface Service<Self, Id extends string, A, E> extends RefSubject<A, E, Self> {\n    readonly id: Id;\n    readonly service: Context.Service<Self, RefSubject<A, E>>;\n    readonly make: <R = never>(value: A | Effect.Effect<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A> & {\n        readonly skip?: number;\n        readonly take?: number;\n    }) => Layer.Layer<Self, never, Exclude<R, Scope.Scope>>;\n    readonly layer: <E2, R2>(make: Effect.Effect<RefSubject<A, E>, E2, R2 | Scope.Scope>) => Layer.Layer<Self, E2, Exclude<R2, Scope.Scope>>;\n}"
    ],
    "summary": "Defines the service state contract.",
    "sections": {
      "Why": "Describes the class-like facade returned by `RefSubject.Service`: it is a Context tag whose\nstatic members also implement current reads, Fx observation, and serialized writes.",
      "Ownership and lifetime": "The contract itself acquires nothing. A matching Layer owns the underlying RefSubject; using\nthe facade requires `Self`, exposes the underlying `E` on reads and pushes, and forwards Scope\nownership to that installed subject.",
      "Property: id": "Exposes id on the ref subject contract.",
      "Property: id: Why": "Preserves the literal Context identifier used to construct and diagnose the service tag.",
      "Property: id: Ownership and lifetime": "This declaration performs no acquisition and retains no resources. Implementations preserve\nsource errors, services, and lifetime.",
      "Property: layer": "Exposes layer on the ref subject contract.",
      "Property: layer: Why": "Converts a scoped Effect that produces a RefSubject into the exact Layer required by the\nfacade, preserving construction failures and non-Scope requirements.",
      "Property: layer: Ownership and lifetime": "Layer acquisition runs `make` once per Layer instance. Its Scope owns the installed subject;\n`E2` is a Layer-construction failure, while the subject's `E` remains on later state access.",
      "Property: make": "Exposes make on the ref subject contract.",
      "Property: make: Why": "Accepts values, Effects, Streams, and Fx through one renderer-independent state constructor\nwhile retaining their typed failures and services.",
      "Property: make: Ownership and lifetime": "The creation Effect requires Scope. It owns initializer acquisition, live source subscriptions,\nand cleanup; source failures and services stay on reads and pushes.",
      "Property: service": "Exposes service on the ref subject contract.",
      "Property: service: Why": "Exposes the exact Effect Context tag used by `layer`, `make`, and every static operation on\nthe facade, so custom Layers can install an existing RefSubject without another wrapper.",
      "Property: service: Ownership and lifetime": "The tag is pure metadata and owns no state. The Layer that provides it owns the installed\nRefSubject and its scoped initializer; operations retrieving it require `Self`."
    },
    "examples": [],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 693
    },
    "since": "1.18.0",
    "category": "Services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.RefSubject.Service",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.RefSubject.Service",
    "declarationKey": "declaration:cd1160eb3a43048fb0080a01",
    "family": "interface",
    "signatures": [
      "interface Service<Self, Id extends string, A, E> extends RefSubject<A, E, Self> {\n    readonly id: Id;\n    readonly service: Context.Service<Self, RefSubject<A, E>>;\n    readonly make: <R = never>(value: A | Effect.Effect<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A> & {\n        readonly skip?: number;\n        readonly take?: number;\n    }) => Layer.Layer<Self, never, Exclude<R, Scope.Scope>>;\n    readonly layer: <E2, R2>(make: Effect.Effect<RefSubject<A, E>, E2, R2 | Scope.Scope>) => Layer.Layer<Self, E2, Exclude<R2, Scope.Scope>>;\n}"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 693,
          "column": 3
        },
        "end": {
          "line": 773,
          "column": 4
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 710,
          "column": 5
        },
        "end": {
          "line": 710,
          "column": 21
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 770,
          "column": 5
        },
        "end": {
          "line": 772,
          "column": 58
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 748,
          "column": 5
        },
        "end": {
          "line": 751,
          "column": 60
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 729,
          "column": 5
        },
        "end": {
          "line": 729,
          "column": 63
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#RefSubject.Service"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject.RefSubject",
    "static": false,
    "importedFrom": "declaration:cd1160eb3a43048fb0080a01"
  },
  "declaration": {
    "declarationKey": "declaration:cd1160eb3a43048fb0080a01",
    "name": "Service",
    "family": "interface",
    "facets": [
      {
        "family": "interface",
        "syntaxKind": "InterfaceDeclaration",
        "signatures": [
          "interface Service<Self, Id extends string, A, E> extends RefSubject<A, E, Self> {\n    readonly id: Id;\n    readonly service: Context.Service<Self, RefSubject<A, E>>;\n    readonly make: <R = never>(value: A | Effect.Effect<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A> & {\n        readonly skip?: number;\n        readonly take?: number;\n    }) => Layer.Layer<Self, never, Exclude<R, Scope.Scope>>;\n    readonly layer: <E2, R2>(make: Effect.Effect<RefSubject<A, E>, E2, R2 | Scope.Scope>) => Layer.Layer<Self, E2, Exclude<R2, Scope.Scope>>;\n}"
        ],
        "typeParameters": [
          "Self",
          "Id extends string",
          "A",
          "E"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 693,
              "column": 3
            },
            "end": {
              "line": 773,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly id: Id;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 710,
              "column": 5
            },
            "end": {
              "line": 710,
              "column": 21
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly layer: <E2, R2>(make: Effect.Effect<RefSubject<A, E>, E2, R2 | Scope.Scope>) => Layer.Layer<Self, E2, Exclude<R2, Scope.Scope>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 770,
              "column": 5
            },
            "end": {
              "line": 772,
              "column": 58
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly make: <R = never>(value: A | Effect.Effect<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A> & {\n    readonly skip?: number;\n    readonly take?: number;\n}) => Layer.Layer<Self, never, Exclude<R, Scope.Scope>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 748,
              "column": 5
            },
            "end": {
              "line": 751,
              "column": 60
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly service: Context.Service<Self, RefSubject<A, E>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 729,
              "column": 5
            },
            "end": {
              "line": 729,
              "column": 63
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      }
    ],
    "signatures": [
      "interface Service<Self, Id extends string, A, E> extends RefSubject<A, E, Self> {\n    readonly id: Id;\n    readonly service: Context.Service<Self, RefSubject<A, E>>;\n    readonly make: <R = never>(value: A | Effect.Effect<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A> & {\n        readonly skip?: number;\n        readonly take?: number;\n    }) => Layer.Layer<Self, never, Exclude<R, Scope.Scope>>;\n    readonly layer: <E2, R2>(make: Effect.Effect<RefSubject<A, E>, E2, R2 | Scope.Scope>) => Layer.Layer<Self, E2, Exclude<R2, Scope.Scope>>;\n}"
    ],
    "typeParameters": [
      "Self",
      "Id extends string",
      "A",
      "E"
    ],
    "summary": "Defines the service state contract.",
    "sections": {
      "Why": "Describes the class-like facade returned by `RefSubject.Service`: it is a Context tag whose\nstatic members also implement current reads, Fx observation, and serialized writes.",
      "Ownership and lifetime": "The contract itself acquires nothing. A matching Layer owns the underlying RefSubject; using\nthe facade requires `Self`, exposes the underlying `E` on reads and pushes, and forwards Scope\nownership to that installed subject.",
      "Property: id": "Exposes id on the ref subject contract.",
      "Property: id: Why": "Preserves the literal Context identifier used to construct and diagnose the service tag.",
      "Property: id: Ownership and lifetime": "This declaration performs no acquisition and retains no resources. Implementations preserve\nsource errors, services, and lifetime.",
      "Property: layer": "Exposes layer on the ref subject contract.",
      "Property: layer: Why": "Converts a scoped Effect that produces a RefSubject into the exact Layer required by the\nfacade, preserving construction failures and non-Scope requirements.",
      "Property: layer: Ownership and lifetime": "Layer acquisition runs `make` once per Layer instance. Its Scope owns the installed subject;\n`E2` is a Layer-construction failure, while the subject's `E` remains on later state access.",
      "Property: make": "Exposes make on the ref subject contract.",
      "Property: make: Why": "Accepts values, Effects, Streams, and Fx through one renderer-independent state constructor\nwhile retaining their typed failures and services.",
      "Property: make: Ownership and lifetime": "The creation Effect requires Scope. It owns initializer acquisition, live source subscriptions,\nand cleanup; source failures and services stay on reads and pushes.",
      "Property: service": "Exposes service on the ref subject contract.",
      "Property: service: Why": "Exposes the exact Effect Context tag used by `layer`, `make`, and every static operation on\nthe facade, so custom Layers can install an existing RefSubject without another wrapper.",
      "Property: service: Ownership and lifetime": "The tag is pure metadata and owns no state. The Layer that provides it owns the installed\nRefSubject and its scoped initializer; operations retrieving it require `Self`."
    },
    "examples": [],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 693,
          "column": 3
        },
        "end": {
          "line": 773,
          "column": 4
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 710,
          "column": 5
        },
        "end": {
          "line": 710,
          "column": 21
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 770,
          "column": 5
        },
        "end": {
          "line": 772,
          "column": 58
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 748,
          "column": 5
        },
        "end": {
          "line": 751,
          "column": 60
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 729,
          "column": 5
        },
        "end": {
          "line": 729,
          "column": 63
        }
      }
    ],
    "since": "1.18.0",
    "category": "Services"
  }
}
