Type guard to check if a string is a valid TLPageId.

function isPageId(id: string): id is TLPageId

Example

if (isPageId('page:main')) {
  // TypeScript knows this is a TLPageId
  console.log('Valid page ID')
}

Parameters

NameDescription

id

string

The string to check

Returns

id is TLPageId

True if the ID is a valid page ID, false otherwise

Prev
isDocument
Next
isShape