@fjell/registry
Version:
Dependency injection and service location system for the Fjell ecosystem
63 lines (46 loc) • 1.92 kB
Markdown
Complete Registry API documentation and method reference.
```typescript
interface Registry {
readonly type: string; // Mandatory type identifier
createInstance: <...>(...) => Instance<...>;
get: (...) => Instance | null;
getCoordinates: () => Coordinate[]; // Discover all registered coordinates
instanceTree: InstanceTree;
}
```
Creates a new registry with the specified type identifier.
Registers a new service instance with the given key type array and scopes.
Retrieves a service instance by key type array and scope options.
Returns all registered coordinates for service discovery and introspection.
```typescript
interface RegistryHub {
registerRegistry: (registry: Registry) => void;
get: (registryType: string, kta: string[], options?: GetOptions) => Instance | null;
getRegistries: () => Registry[];
getAllCoordinates: () => Array<{coordinate: Coordinate, registryType: string}>;
}
```
```typescript
interface Coordinate {
kta: string[]; // Key Type Array - hierarchical identifiers
scopes: string[]; // Context qualifiers
}
```
For comprehensive API documentation with detailed examples, implementation patterns, and advanced usage scenarios, see the **Foundation** section which contains the complete Registry documentation including:
- Interface definitions and type signatures
- Detailed method documentation with examples
- Registry and RegistryHub patterns
- Coordinate system explanation
- Service discovery and introspection
- Error handling and best practices
The Foundation section serves as the authoritative API reference with full context and examples.