isPageId
See source codeType guard to check if a string is a valid TLPageId.
function isPageId(id: string): id is TLPageIdExample
if (isPageId('page:main')) {
// TypeScript knows this is a TLPageId
console.log('Valid page ID')
}Parameters
| Name | Description |
|---|---|
| The string to check |
Returns
id is TLPageIdTrue if the ID is a valid page ID, false otherwise
Prev
isDocumentNext
isShape