Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

Snowflake.ts overview

Since v1.0.0


Exports Grouped by Category


Epoch

constEpochMillis

Signature

declare const constEpochMillis: number

Source

Since v1.0.0

Generator

Generator (class)

Signature

declare class Generator

Source

Since v1.0.0

layerGenerator

Signature

declare const layerGenerator: Layer.Layer<Generator, never, never>

Source

Since v1.0.0

makeGenerator

Signature

declare const makeGenerator: Effect.Effect<Snowflake.Generator, never, never>

Source

Since v1.0.0

Models

Snowflake

Signature

declare const Snowflake: (input: string | bigint) => Snowflake

Source

Since v1.0.0

Snowflake (type alias)

Signature

type Snowflake = Brand.Branded<bigint, TypeId>

Source

Since v1.0.0

Snowflake (namespace)

Source

Since v1.0.0

Parts (interface)

Signature

export interface Parts {
  readonly timestamp: number
  readonly machineId: MachineId
  readonly sequence: number
}

Source

Since v1.0.0

Generator (interface)

Signature

export interface Generator {
  readonly unsafeNext: () => Snowflake
  readonly setMachineId: (machineId: MachineId) => Effect.Effect<void>
}

Source

Since v1.0.0

Parts

dateTime

Signature

declare const dateTime: (snowflake: Snowflake) => DateTime.Utc

Source

Since v1.0.0

machineId

Signature

declare const machineId: (snowflake: Snowflake) => MachineId

Source

Since v1.0.0

sequence

Signature

declare const sequence: (snowflake: Snowflake) => number

Source

Since v1.0.0

timestamp

Signature

declare const timestamp: (snowflake: Snowflake) => number

Source

Since v1.0.0

toParts

Signature

declare const toParts: (snowflake: Snowflake) => Snowflake.Parts

Source

Since v1.0.0

Schemas

SnowflakeFromBigInt

Signature

declare const SnowflakeFromBigInt: Schema.Schema<Snowflake, bigint, never>

Source

Since v1.0.0

SnowflakeFromString

Signature

declare const SnowflakeFromString: Schema.Schema<Snowflake, string, never>

Source

Since v1.0.0

Symbols

TypeId

Signature

declare const TypeId: unique symbol

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v1.0.0

constructors

make

Signature

declare const make: (options: {
  readonly machineId: MachineId
  readonly sequence: number
  readonly timestamp: number
}) => Snowflake

Source

Since v1.0.0