Skip to content

FormatRelativeBucket — @gj-kit/format

A public type from @gj-kit/format. The signature below is taken directly from the 0.1.1 release declaration.

import { FormatRelativeBucket } from '@gj-kit/format';
/** Structured relative-time classification; render copy yourself or via formatRelativeKo. */
type FormatRelativeBucket =
/** `ms` counts milliseconds *until* the value, always positive. */
{
readonly kind: 'future';
readonly ms: number;
} | {
readonly kind: 'just-now';
readonly seconds: number;
} | {
readonly kind: 'minutes';
readonly count: number;
} | {
readonly kind: 'hours';
readonly count: number;
} | {
readonly kind: 'days';
readonly count: number;
} | {
readonly kind: 'months';
readonly count: number;
} | {
readonly kind: 'years';
readonly count: number;
};

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/format
  • Version: 0.1.1
  • Public entry: .
  • Source: GitHub