Skip to content

amdomnig/types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Types

Typescript types and zod schemas for The Wired.

Installation

npm install @wired-protocol/types

Usage

Use zod to validate unsafe objects. Useful when reading data from unknown sources, such as from a world.json file or messages from the host.

import { WorldMetadataSchema } from "@wired-protocol/types";

const unsafeObject: any = {
  info: {
    name: "My World",
    description: "A description of the world.",
    image: "./image.jpg",
    host: "host.unavi.xyz",
  },
  model: "./world.gltf",
};

const metadata = WorldMetadataSchema.parse(unsafeObject);
//    ^? const metadata: WorldMetadata

About

Typescript types and zod schemas for The Wired.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors