- From: Drew Williams via GitHub <sysbot+gh@w3.org>
- Date: Thu, 18 Nov 2021 23:08:31 +0000
- To: public-web-nfc@w3.org
> > As you can see at https://w3c.github.io/web-nfc/#data-mapping, `recordType` can be any string that follows a certain pattern (See local type and external type). > > Is it possible in TypeScript to have something like below? > > ```ts > > readonly recordType: NDEFRecordTypes | string; > > ``` > > > > > > > > > > > > > > > > > > > > > > > > or > > ```ts > > type NDEFRecordTypes = string | "absolute-url" | "empty" | "mime" | "smart-poster" | "text" | "unknown" | "URL"; > > ``` > > Ah, good to know, there's still plenty I have left to read. Thanks for that. You are correct, the following example you gave is valid TypeScript, the other one was not: > > ```ts > type NDEFRecordTypes = string | "absolute-url" | "empty" | "mime" | "smart-poster" | "text" | "unknown" | "URL"; > ``` > > I've gone ahead and updated the original commit. Is there more to it than that? -- GitHub Notification of comment by drewmw5 Please view or discuss this issue at https://github.com/w3c/web-nfc/pull/629#issuecomment-973388335 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 18 November 2021 23:08:33 UTC