the-moby-effect
Version:
Moby/Docker API client built using effect-ts
46 lines (40 loc) • 1.02 kB
text/typescript
/**
* 64bit signed integer schema.
*
* @since 1.0.0
*/
import * as Brand from "effect/Brand";
import * as Function from "effect/Function";
import * as Schema from "effect/Schema";
/**
* @since 1.0.0
* @category Branded types
*/
export type Int64Brand = number & Brand.Brand<"Int64">;
/**
* @since 1.0.0
* @category Branded constructors
*/
export const Int64Brand: Brand.Brand.Constructor<Int64Brand> = Brand.nominal<Int64Brand>();
/**
* @since 1.0.0
* @category Api interface
*/
export interface $Int64 extends Schema.Annotable<$Int64, Int64Brand, Brand.Brand.Unbranded<Int64Brand>, never> {}
/**
* 64bit signed integer.
*
* @since 1.0.0
* @category Schemas
*/
export const Int64: $Int64 = Function.pipe(
Schema.Number,
Schema.greaterThanOrEqualTo(-(2 ** 63)),
Schema.lessThanOrEqualTo(2 ** 63 - 1),
Schema.fromBrand(Int64Brand),
Schema.annotations({
identifier: "Int64",
title: "64-bit signed integer",
description: "A 64-bit signed integer.",
})
);