Skip to main content

flowjs_rs/
flow_type.rs

1//! Flow built-in type names.
2//!
3//! Every primitive and special type in Flow's type system is defined here as a
4//! constant. No code in this crate should use raw string literals for Flow
5//! type names — always reference these constants instead.
6
7/// `string` — text values.
8pub const STRING: &str = "string";
9
10/// `number` — numeric values (integer and floating-point).
11pub const NUMBER: &str = "number";
12
13/// `boolean` — true/false.
14pub const BOOLEAN: &str = "boolean";
15
16/// `void` — absence of a value (unit type).
17pub const VOID: &str = "void";
18
19/// `null` — explicit null.
20pub const NULL: &str = "null";
21
22/// `mixed` — the top type (any value, unknown shape).
23pub const MIXED: &str = "mixed";
24
25/// `any` — opt-out of type checking.
26pub const ANY: &str = "any";
27
28/// `empty` — the bottom type (no value inhabits this type).
29pub const EMPTY: &str = "empty";
30
31/// `bigint` — arbitrary-precision integers.
32pub const BIGINT: &str = "bigint";
33
34/// `symbol` — unique symbols.
35pub const SYMBOL: &str = "symbol";
36
37/// `$ReadOnlyArray` — immutable array generic.
38pub const READ_ONLY_ARRAY: &str = "$ReadOnlyArray";