2.0.3-ts.1 • Published 2 years ago

@rbxts/sheetvalues v2.0.3-ts.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SheetValues

TS typings for boatbomber's SheetValues.

Installation

NPM

Run npm i @rbxts/sheetvalues in your project directory.

Usage

With a sheet like this:

NameSomeKeySomeOtherKey
Foo50test
Bar90test2

One can extract values with the following code:

import SheetValues from "@rbxts/sheetvalues";

// The type parameter represents the sheet
const sheet = new SheetValues<{
  Foo: {
    SomeKey: number;
    SomeOtherKey: string;
  };
  Bar: {
    SomeKey: number;
    SomeOtherKey: string;
  };
}>("Spread id extracted from the URL");

const a = sheet.Values.Foo.SomeKey; // 50
const b = sheet.Values.Bar.SomeOtherKey; // "test2"

To contribute to SheetValues, please file Pull Requests and Issues in its GitHub repository, and not in the repository of this package. The types here will reflect the most recent release of the Luau code.