types APIs
- SimpleOptions
- RootState
- User
- ChainType
- FeedbackCategoryAPI
- FeedbackStatusAPI
- FeedbackUserProfileAPI
- NavItems
- SingleNavItem
- NonNullableChildrenDeep
- SingleArticle
- ColumnType
- DataType
- Hub
- PluginConfig
- RawEventMessage
- DualStakingInfo
- StakingInfo
- SyrupInfo
- CommonStakingInfo
- LairInfo
- StakingBasic
- DualStakingBasic
- SyrupBasic
- Questionnaire
- TaskStatuses
- LoginPayload
- SignupPayload
- MutationType
- ProteinSize
- Config
- Themes
- defaults
- CoordinateSpaceInitial
- Background
- Metric
- Metadata
- TManageValue
- Domain
- Organization
- OrganizationTag
- Scan
- ScanSchema
- Query
- SavedSearch
- Role
- ScanTask
- Vulnerability
- GenericObject
- Annotation
- AnnotationList
- VideoAnnotation
- IconName
- IllustrationName
- INotification
- BottomTabScreens
- KYCScreens
- CCVPScreens
- LoginScreens
- PreAuthScreens
- SignUpScreens
- TFAScreens
- PNVScreens
- ProfileScreens
- SecurityScreens
- SMTYFScreens
- WalletScreens
- WithdrawalScreens
- StackNavigationProps
- Coin
- Country
- TransactionStatus
- SetApiActionPayloadInterface
- LoadingStateInterface
- MessageStateInterface
- UiOptionType
- ApiDiffInterface
- ApiStateInterface
- Account
- NFT
- NFTDetails
- AlertType
- DefaultTemplateOptions
- ProviderProps
- AlertTimer
- AlertInstance
- AlertOptions
- TemplateAlertOptions
- AlertContainerFactory
- ChainBase
- ChainNetwork
- WalletId
- ProposalType
- ChainEventNotification
- WebsocketMessageNames
- WebsocketNamespaces
- NotificationCategories
- InviteCodeAttributes
- IPostNotificationData
- ChainCategoryType
- Screens
- NavigationProperty
- IP
- Maybe
- Tuple
- ChainProperties
- ApiPromise
- ApiAction
- BlueprintOptions
- ContractQuery
- ContractOptions
- ContractTx
- KeyringPair
- ContractDryRunParams
- InstantiateData
- SubmittableExtrinsic
- DbState
- OnInstantiateSuccess$Code
- OnInstantiateSuccess$Hash
- InstantiateState
- ApiState
- OrFalsy
- Bytes
- AbiParam
- Registry
- Weight
- SubmittableResult
- Hash
- CodeBundleDocument
- MyCodeBundles
- ContractDocument
- MyContracts
- Database
- DbStatistics
- UserDocument
- QueuedTxOptions
- TransactionsState
- DropdownOption
- DropdownProps
- ValidFormField
- SetState
- BN
- CallResult
- ContractPromise
- RegistryError
- Abi
- TypeDef
- Validation
- FileState
- UseWeight
- ArgComponentProps
- TypeDefInfo
- UseMetadata
- AbiMessage
- AbiConstructor
- InstantiateProps
- CodeSubmittableResult
- BlueprintSubmittableResult
- BlueprintPromise
- Step2FormData
- TxOptions
- TransactionsQueue
- Keyring
- DbQuery
- UseBalance
- CodeBundle
- ValidateFn
- MetadataState
- UseStepper
- UseToggle
- Party
- Restaurant
- BoardMember
- Id
- Label
- Priority
- Avatar
- PriorityValue
- AuthSetup
- IColumn
- Board
- ITask
- TaskComment
- NewTaskComment
- WithTheme
- UserDetail
- TasksByColumn
- NewTask
- ValueOf
- APIResponse
- Nullable
- Currency
- Route
- Author
- Post
- Category
- Watch
- ComputeCallback
Other Related APIs
types#AnnotationList TypeScript Examples
The following examples show how to use
types#AnnotationList.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: annotationFileUtils.tsx From obsidian-annotator with GNU Affero General Public License v3.0 | 6 votes |
export async function loadAnnotations(
url: URL | null,
vault: Vault,
annotationFilePath: string
): Promise<AnnotationList> {
const tfile = vault.getAbstractFileByPath(annotationFilePath);
if (tfile instanceof TFile) {
const text = await vault.read(tfile);
return loadAnnotationsAtUriFromFileText(url, text);
} else {
return loadAnnotationsAtUriFromFileText(url, null);
}
}
Example #2
Source File: annotationUtils.tsx From obsidian-annotator with GNU Affero General Public License v3.0 | 6 votes |
export function loadAnnotationsAtUriFromFileText(url: URL | null, fileText: string | null): AnnotationList {
const params = url ? Object.fromEntries(url.searchParams.entries()) : null;
if (params?.uri == 'app://obsidian.md/index.html') {
return { rows: [], total: 0 };
}
const rows = [];
const annotationRegex = makeAnnotationBlockRegex();
if (fileText !== null) {
let m: RegExpExecArray;
while ((m = annotationRegex.exec(fileText)) !== null) {
if (m.index === annotationRegex.lastIndex) {
annotationRegex.lastIndex++;
}
const {
groups: { annotationBlock, annotationId }
} = m;
const completeAnnotation = getAnnotationFromAnnotationBlock(annotationBlock, annotationId);
const annotationDocumentIdentifiers = [
completeAnnotation.document?.documentFingerprint,
completeAnnotation.uri
];
//The check against SAMPLE_PDF_URL is for backwards compability.
if (
url === null ||
annotationDocumentIdentifiers.includes(params.uri) ||
annotationDocumentIdentifiers.includes(encodeURI(params.uri)) ||
annotationDocumentIdentifiers.includes(decodeURI(params.uri)) ||
annotationDocumentIdentifiers.includes(SAMPLE_PDF_URL)
) {
rows.push(completeAnnotation);
}
}
}
return { rows, total: rows.length };
}