@apiref-examples/core module
Example package demonstrating apiref's documentation generation features.
This package showcases:
- Multi-signature methods and functions
- Callable interfaces with multiple call signatures
- Generic types and constraints
- Mapped types with readonly and optional modifiers
- Classes with various member types
- Interfaces and type aliases
- Enums and deeply nested namespaces
- Re-exported modules as namespaces
Namespaces
createEmitter namespace
Namespace containing emitter-related types and utilities.
UI namespace
Deeply nested namespace examples.
Validator namespace
Email validator function with configurable patterns namespace.
Can be used as a function: validator.isEmail("test@example.com")
Or configured via namespace: validator.patterns.strict
Enumerations
ErrorCategory enum
Type representing different error categories.
Classes
ApiError class
A custom error class with categorization.
BaseGreeter class
Base greeter with a reusable greeting method.
Builder class
A builder pattern implementation with fluent interface.
Cache class
A simple in-memory cache with generic support and multiple access patterns.
DataProcessor class
A generic data processor with multiple execution modes.
FriendlyGreeter class
Friendly greeter that inherits its greeting behavior.
Interfaces
CacheEntry interface
Represents a cached value with metadata.
MessageFormatter interface
Format a plain message.
ProcessOptions interface
Options for data processing.
Type Aliases
AppConfig type-alias
Type derived from the default config
ChangeHandlers type-alias
Maps each property to an optional change handler.
Result type-alias
Generic result type that can hold either a success value or an error.
SqlQuery type-alias
SQL query string template literal type
StrictReadonly type-alias
Makes every property readonly and required.
Variables
defaultConfig variable
Configuration object that also serves as a type template.
Can be used as a value: defaultConfig
Or as a type template: type Config = typeof defaultConfig
Functions
createEmitter function
Event emitter factory with associated namespace for event types.
Can be used as a function: createEmitter<MyEvents>()
Or typed via namespace: Emitter.EventMap
createTuple function
Create a tuple type constraint helper.
isNumber function
Type guard for checking whether a value is a number.
joinStrings function
Join multiple strings into one value.
merge function
Merge multiple objects with generic type support.
parse function
Parse a value that could be a string, number, or object.
A utility function with multiple signatures for flexible usage.
parseAsync function
Async version of parse with result wrapper.
References
Auth property
References
default property
References