my-swiss-knife: - v1.9.9
    Preparing search index...

    Type Alias ObjectType<T>

    ObjectType: Record<string | number, T>

    Represents an object type with string or number keys and values of type T.

    This utility type is a shorthand for objects where keys can be either string or number, and all values have the same type T.

    Type Parameters

    • T = unknown

      The type of the object’s values. Defaults to unknown.

    type UserMap = ObjectType<User>;
    // Equivalent to: Record<string | number, User>

    const users: UserMap = {
    1: { name: "Alice" },
    "2": { name: "Bob" }
    };
    export type ObjectType<T = unknown> = Record<string | number, T>