@syntropylog/types
v0.1.5
Published
Shared types for SyntropyLog ecosystem
Maintainers
Readme
@syntropylog/types
Shared types for the SyntropyLog ecosystem.
Version 0.1.5
New in this version:
- Updated package-lock.json and dependencies
- Improved type definitions for better TypeScript support
- Streamlined types for better performance and consistency
- Removed deprecated types to reduce bundle size
Overview
This package contains the fundamental types used across the SyntropyLog ecosystem. These types are designed to be shared between the main library and future modules like adapters and serializers.
Installation
npm install @syntropylog/typesUsage
import {
JsonValue,
LogMetadata,
ILogger,
IContextManager,
RedisValue
} from '@syntropylog/types';
// Use types in your implementations
const metadata: LogMetadata = {
userId: '123',
operation: 'create',
timestamp: Date.now()
};
// Implement interfaces
class MyLogger implements ILogger {
// Implementation...
}Available Types
Base Types
JsonValue- Any value that can be safely serialized to JSONSerializableData- Union type for all data types that can be serialized
Logging Types
LogMetadata- Type for log metadata objectsLogBindings- Type for log bindings attached to logger instancesLogRetentionRules- Type for retention rulesLogFormatArg- Type for format argumentsLogArguments- Type for logging method argumentsILogger- Base interface for logger implementations
Context Types
ContextValue- Type for values that can be stored in contextContextData- Type for context data structureContextConfig- Type for context configuration optionsIContextManager- Base interface for context manager implementations
Redis Types
RedisValue- Type for Redis valuesRedisListElement- Type for Redis list elementsRedisSetMember- Type for Redis set membersRedisSortedSetMember- Type for Redis sorted set membersRedisHashValue- Type for Redis hash field valuesRedisCommandOptions- Type for Redis command options
Serialization Types
SerializedData- Type for serialization result dataSerializationContextConfig- Type for serialization context configurationSanitizationConfig- Type for sanitization configurationSerializationPipelineContext- Type for pipeline contextSerializationResult- Type for serialization resultSerializationMetadata- Type for serialization metadataSerializationMetrics- Type for serialization metricsComplexityDistribution- Type for complexity distribution metricsSerializerDistribution- Type for serializer distribution metricsTimeoutStrategyDistribution- Type for timeout strategy distribution metrics
Logging Types
LogEntry- Type for log entry structureLoggerOptions- Type for logger optionsLoggerDependencies- Type for logger dependencies
Development
# Build the package
npm run build
# Clean build artifacts
npm run cleanLicense
MIT
