Snowflake.ts overview
Since v1.0.0
Exports Grouped by Category
Epoch
constEpochMillis
Signature
declare const constEpochMillis: number
Since v1.0.0
Generator
Generator (class)
Signature
declare class Generator
Since v1.0.0
layerGenerator
Signature
declare const layerGenerator: Layer.Layer<Generator>
Since v1.0.0
makeGenerator
Signature
declare const makeGenerator: Effect.Effect<Snowflake.Generator>
Since v1.0.0
Models
Snowflake
Signature
declare const Snowflake: (input: string | bigint) => Snowflake
Since v1.0.0
Snowflake (type alias)
Signature
type Snowflake = Brand.Branded<bigint, TypeId>
Since v1.0.0
Snowflake (namespace)
Since v1.0.0
Parts (interface)
Signature
export interface Parts {
readonly timestamp: number
readonly machineId: MachineId
readonly sequence: number
}
Since v1.0.0
Generator (interface)
Signature
export interface Generator {
readonly unsafeNext: () => Snowflake
readonly setMachineId: (machineId: MachineId) => Effect.Effect<void>
}
Since v1.0.0
Parts
dateTime
Signature
declare const dateTime: (snowflake: Snowflake) => DateTime.Utc
Since v1.0.0
machineId
Signature
declare const machineId: (snowflake: Snowflake) => MachineId
Since v1.0.0
sequence
Signature
declare const sequence: (snowflake: Snowflake) => number
Since v1.0.0
timestamp
Signature
declare const timestamp: (snowflake: Snowflake) => number
Since v1.0.0
toParts
Signature
declare const toParts: (snowflake: Snowflake) => Snowflake.Parts
Since v1.0.0
Schemas
SnowflakeFromBigInt
Signature
declare const SnowflakeFromBigInt: Schema.Schema<Brand.Branded<bigint, unique symbol>, bigint>
Since v1.0.0
SnowflakeFromString
Signature
declare const SnowflakeFromString: Schema.Schema<Brand.Branded<bigint, unique symbol>, string>
Since v1.0.0
Symbols
TypeId
Signature
declare const TypeId: unique symbol
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = typeof TypeId
Since v1.0.0
constructors
make
Signature
declare const make: (options: {
readonly machineId: MachineId
readonly sequence: number
readonly timestamp: number
}) => Snowflake
Since v1.0.0