roamjs-components 0.53.2 → 0.53.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +154 -154
- package/backend/emailCatch.d.ts +4 -4
- package/backend/emailCatch.js +11 -11
- package/backend/emailError.d.ts +4 -4
- package/backend/emailError.js +56 -56
- package/backend/getRoamJSUser.d.ts +11 -11
- package/backend/getRoamJSUser.js +30 -30
- package/backend/headers.d.ts +5 -5
- package/backend/headers.js +7 -7
- package/backend/index.d.ts +6 -6
- package/backend/index.js +20 -20
- package/backend/meterRoamJSUser.d.ts +4 -4
- package/backend/meterRoamJSUser.js +14 -14
- package/backend/putRoamJSUser.d.ts +10 -10
- package/backend/putRoamJSUser.js +25 -25
- package/components/BlockErrorBoundary.d.ts +15 -15
- package/components/BlockErrorBoundary.js +27 -27
- package/components/BlockInput.d.ts +12 -12
- package/components/BlockInput.js +53 -53
- package/components/ComponentContainer.d.ts +9 -9
- package/components/ComponentContainer.js +46 -46
- package/components/ConfigPage.d.ts +99 -99
- package/components/ConfigPage.js +751 -751
- package/components/CursorMenu.d.ts +21 -21
- package/components/CursorMenu.js +181 -181
- package/components/Description.d.ts +5 -5
- package/components/Description.js +16 -16
- package/components/ExternalLogin.d.ts +18 -18
- package/components/ExternalLogin.js +131 -131
- package/components/Filter.d.ts +14 -14
- package/components/Filter.js +147 -147
- package/components/Loading.d.ts +4 -4
- package/components/Loading.js +33 -33
- package/components/MenuItemSelect.d.ts +10 -10
- package/components/MenuItemSelect.js +13 -13
- package/components/OauthSelect.d.ts +5 -5
- package/components/OauthSelect.js +25 -25
- package/components/PageInput.d.ts +10 -10
- package/components/PageInput.js +69 -69
- package/components/ServiceComponents.d.ts +49 -49
- package/components/ServiceComponents.js +277 -277
- package/components/SimpleAlert.d.ts +12 -12
- package/components/SimpleAlert.js +38 -38
- package/components/Toast.d.ts +10 -10
- package/components/Toast.js +41 -41
- package/components/TokenDialog.d.ts +11 -11
- package/components/TokenDialog.js +100 -100
- package/components/index.d.ts +15 -15
- package/components/index.js +60 -60
- package/date/constants.d.ts +2 -2
- package/date/constants.js +5 -5
- package/date/index.d.ts +5 -5
- package/date/index.js +13 -13
- package/date/parseRoamDate.d.ts +2 -2
- package/date/parseRoamDate.js +6 -6
- package/date/parseRoamDateUid.d.ts +2 -2
- package/date/parseRoamDateUid.js +6 -6
- package/date/toRoamDate.d.ts +2 -2
- package/date/toRoamDate.js +6 -6
- package/date/toRoamDateUid.d.ts +2 -2
- package/date/toRoamDateUid.js +6 -6
- package/dom/addBlockCommand.d.ts +5 -5
- package/dom/addBlockCommand.js +53 -53
- package/dom/addOldRoamJSDependency.d.ts +2 -2
- package/dom/addOldRoamJSDependency.js +10 -10
- package/dom/addRoamJSDependency.d.ts +2 -2
- package/dom/addRoamJSDependency.js +8 -8
- package/dom/addScriptAsDependency.d.ts +6 -6
- package/dom/addScriptAsDependency.js +16 -16
- package/dom/addStyle.d.ts +2 -2
- package/dom/addStyle.js +14 -14
- package/dom/constants.d.ts +1 -1
- package/dom/constants.js +4 -4
- package/dom/createBlockObserver.d.ts +7 -7
- package/dom/createBlockObserver.js +43 -43
- package/dom/createButtonObserver.d.ts +6 -6
- package/dom/createButtonObserver.js +21 -21
- package/dom/createDivObserver.d.ts +2 -2
- package/dom/createDivObserver.js +8 -8
- package/dom/createHTMLObserver.d.ts +8 -8
- package/dom/createHTMLObserver.js +24 -24
- package/dom/createHashtagObserver.d.ts +5 -5
- package/dom/createHashtagObserver.js +16 -16
- package/dom/createIconButton.d.ts +2 -2
- package/dom/createIconButton.js +12 -12
- package/dom/createObserver.d.ts +2 -2
- package/dom/createObserver.js +6 -6
- package/dom/createOverlayObserver.d.ts +2 -2
- package/dom/createOverlayObserver.js +6 -6
- package/dom/createPageObserver.d.ts +2 -2
- package/dom/createPageObserver.js +34 -34
- package/dom/createPageTitleObserver.d.ts +6 -6
- package/dom/createPageTitleObserver.js +29 -29
- package/dom/genericError.d.ts +4 -4
- package/dom/genericError.js +16 -16
- package/dom/getActiveUids.d.ts +3 -3
- package/dom/getActiveUids.js +6 -6
- package/dom/getBlockUidFromTarget.d.ts +2 -2
- package/dom/getBlockUidFromTarget.js +33 -33
- package/dom/getCurrentPageUid.d.ts +2 -2
- package/dom/getCurrentPageUid.js +6 -6
- package/dom/getDomRefs.d.ts +2 -2
- package/dom/getDomRefs.js +12 -12
- package/dom/getDropUidOffset.d.ts +5 -5
- package/dom/getDropUidOffset.js +27 -27
- package/dom/getMutatedNodes.d.ts +7 -7
- package/dom/getMutatedNodes.js +11 -11
- package/dom/getPageTitleByHtmlElement.d.ts +2 -2
- package/dom/getPageTitleByHtmlElement.js +12 -12
- package/dom/getPageTitleValueByHtmlElement.d.ts +2 -2
- package/dom/getPageTitleValueByHtmlElement.js +27 -27
- package/dom/getReferenceBlockUid.d.ts +2 -2
- package/dom/getReferenceBlockUid.js +18 -18
- package/dom/getRoamUrl.d.ts +2 -2
- package/dom/getRoamUrl.js +4 -4
- package/dom/getRoamUrlByPage.d.ts +2 -2
- package/dom/getRoamUrlByPage.js +10 -10
- package/dom/getUids.d.ts +3 -3
- package/dom/getUids.js +8 -8
- package/dom/getUidsFromButton.d.ts +3 -3
- package/dom/getUidsFromButton.js +9 -9
- package/dom/getUidsFromId.d.ts +5 -5
- package/dom/getUidsFromId.js +15 -15
- package/dom/index.d.ts +31 -31
- package/dom/index.js +65 -65
- package/dom/openBlock.d.ts +2 -2
- package/dom/openBlock.js +6 -6
- package/dom/openBlockElement.d.ts +2 -2
- package/dom/openBlockElement.js +16 -16
- package/dom/parseRoamBlocksToHtml.d.ts +9 -9
- package/dom/parseRoamBlocksToHtml.js +75 -75
- package/dom/resolveRefs.d.ts +2 -2
- package/dom/resolveRefs.js +24 -24
- package/events/index.d.ts +1 -1
- package/events/index.js +8 -8
- package/events/watchOnce.d.ts +3 -3
- package/events/watchOnce.js +11 -11
- package/hooks/index.d.ts +3 -3
- package/hooks/index.js +12 -12
- package/hooks/useArrowKeyDown.d.ts +8 -8
- package/hooks/useArrowKeyDown.js +31 -31
- package/hooks/useRoamJSTokenWarning.d.ts +2 -2
- package/hooks/useRoamJSTokenWarning.js +11 -11
- package/hooks/useSubTree.d.ts +3 -3
- package/hooks/useSubTree.js +11 -11
- package/index.d.ts +11 -11
- package/index.js +14 -14
- package/marked/index.d.ts +14 -14
- package/marked/index.js +518 -518
- package/package.json +86 -86
- package/queries/getAllBlockUids.d.ts +2 -2
- package/queries/getAllBlockUids.js +6 -6
- package/queries/getAllBlockUidsAndTexts.d.ts +5 -5
- package/queries/getAllBlockUidsAndTexts.js +6 -6
- package/queries/getAllPageNames.d.ts +2 -2
- package/queries/getAllPageNames.js +6 -6
- package/queries/getAttributeValueByBlockAndName.d.ts +5 -5
- package/queries/getAttributeValueByBlockAndName.js +11 -11
- package/queries/getBasicTreeByParentUid.d.ts +3 -3
- package/queries/getBasicTreeByParentUid.js +13 -13
- package/queries/getBlockUidAndTextIncludingText.d.ts +5 -5
- package/queries/getBlockUidAndTextIncludingText.js +6 -6
- package/queries/getBlockUidByTextOnPage.d.ts +5 -5
- package/queries/getBlockUidByTextOnPage.js +7 -7
- package/queries/getBlockUidsAndTextsReferencingPage.d.ts +5 -5
- package/queries/getBlockUidsAndTextsReferencingPage.js +11 -11
- package/queries/getBlockUidsByPageTitle.d.ts +2 -2
- package/queries/getBlockUidsByPageTitle.js +8 -8
- package/queries/getBlockUidsReferencingBlock.d.ts +2 -2
- package/queries/getBlockUidsReferencingBlock.js +6 -6
- package/queries/getBlockUidsReferencingPage.d.ts +2 -2
- package/queries/getBlockUidsReferencingPage.js +8 -8
- package/queries/getBlockUidsWithParentUid.d.ts +2 -2
- package/queries/getBlockUidsWithParentUid.js +6 -6
- package/queries/getChildrenLengthByPageUid.d.ts +2 -2
- package/queries/getChildrenLengthByPageUid.js +4 -4
- package/queries/getCreateTimeByBlockUid.d.ts +2 -2
- package/queries/getCreateTimeByBlockUid.js +7 -7
- package/queries/getCurrentUser.d.ts +2 -2
- package/queries/getCurrentUser.js +11 -11
- package/queries/getCurrentUserDisplayName.d.ts +2 -2
- package/queries/getCurrentUserDisplayName.js +13 -13
- package/queries/getCurrentUserEmail.d.ts +2 -2
- package/queries/getCurrentUserEmail.js +13 -13
- package/queries/getCurrentUserUid.d.ts +2 -2
- package/queries/getCurrentUserUid.js +13 -13
- package/queries/getDisplayNameByEmail.d.ts +2 -2
- package/queries/getDisplayNameByEmail.js +7 -7
- package/queries/getDisplayNameByUid.d.ts +2 -2
- package/queries/getDisplayNameByUid.js +7 -7
- package/queries/getEditTimeByBlockUid.d.ts +2 -2
- package/queries/getEditTimeByBlockUid.js +7 -7
- package/queries/getEditedUserEmailByBlockUid.d.ts +2 -2
- package/queries/getEditedUserEmailByBlockUid.js +7 -7
- package/queries/getFirstChildTextByBlockUid.d.ts +2 -2
- package/queries/getFirstChildTextByBlockUid.js +7 -7
- package/queries/getFirstChildUidByBlockUid.d.ts +2 -2
- package/queries/getFirstChildUidByBlockUid.js +5 -5
- package/queries/getFullTreeByParentUid.d.ts +3 -3
- package/queries/getFullTreeByParentUid.js +26 -26
- package/queries/getLinkedPageTitlesUnderUid.d.ts +2 -2
- package/queries/getLinkedPageTitlesUnderUid.js +6 -6
- package/queries/getNthChildUidByBlockUid.d.ts +5 -5
- package/queries/getNthChildUidByBlockUid.js +7 -7
- package/queries/getOrderByBlockUid.d.ts +2 -2
- package/queries/getOrderByBlockUid.js +7 -7
- package/queries/getPageTitleByBlockUid.d.ts +2 -2
- package/queries/getPageTitleByBlockUid.js +7 -7
- package/queries/getPageTitleByPageUid.d.ts +2 -2
- package/queries/getPageTitleByPageUid.js +9 -9
- package/queries/getPageTitleReferencesByPageTitle.d.ts +2 -2
- package/queries/getPageTitleReferencesByPageTitle.js +8 -8
- package/queries/getPageTitlesAndBlockUidsReferencingPage.d.ts +5 -5
- package/queries/getPageTitlesAndBlockUidsReferencingPage.js +8 -8
- package/queries/getPageTitlesAndUidsDirectlyReferencingPage.d.ts +5 -5
- package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js +8 -8
- package/queries/getPageTitlesReferencingBlockUid.d.ts +2 -2
- package/queries/getPageTitlesReferencingBlockUid.js +6 -6
- package/queries/getPageTitlesStartingWithPrefix.d.ts +2 -2
- package/queries/getPageTitlesStartingWithPrefix.js +6 -6
- package/queries/getPageUidByPageTitle.d.ts +2 -2
- package/queries/getPageUidByPageTitle.js +9 -9
- package/queries/getPageViewType.d.ts +3 -3
- package/queries/getPageViewType.js +9 -9
- package/queries/getParentTextByBlockUid.d.ts +2 -2
- package/queries/getParentTextByBlockUid.js +7 -7
- package/queries/getParentTextByBlockUidAndTag.d.ts +5 -5
- package/queries/getParentTextByBlockUidAndTag.js +7 -7
- package/queries/getParentUidByBlockUid.d.ts +2 -2
- package/queries/getParentUidByBlockUid.js +7 -7
- package/queries/getParentUidsOfBlockUid.d.ts +2 -2
- package/queries/getParentUidsOfBlockUid.js +6 -6
- package/queries/getSettingsByEmail.d.ts +3 -3
- package/queries/getSettingsByEmail.js +7 -7
- package/queries/getShallowTreeByParentUid.d.ts +5 -5
- package/queries/getShallowTreeByParentUid.js +10 -10
- package/queries/getTextByBlockUid.d.ts +2 -2
- package/queries/getTextByBlockUid.js +7 -7
- package/queries/index.d.ts +45 -45
- package/queries/index.js +96 -96
- package/queries/isTagOnPage.d.ts +5 -5
- package/queries/isTagOnPage.js +9 -9
- package/queries/normalizePageTitle.d.ts +2 -2
- package/queries/normalizePageTitle.js +4 -4
- package/types/index.d.ts +461 -459
- package/types/index.js +2 -2
- package/types/query-builder.d.ts +16 -16
- package/types/query-builder.js +2 -2
- package/util/addInputSetting.d.ts +7 -7
- package/util/addInputSetting.js +25 -25
- package/util/apiDelete.d.ts +2 -2
- package/util/apiDelete.js +9 -9
- package/util/apiGet.d.ts +2 -2
- package/util/apiGet.js +9 -9
- package/util/apiPost.d.ts +2 -2
- package/util/apiPost.js +9 -9
- package/util/apiPut.d.ts +2 -2
- package/util/apiPut.js +9 -9
- package/util/createOverlayRender.d.ts +6 -6
- package/util/createOverlayRender.js +18 -18
- package/util/createTagRegex.d.ts +2 -2
- package/util/createTagRegex.js +4 -4
- package/util/extractRef.d.ts +2 -2
- package/util/extractRef.js +8 -8
- package/util/extractTag.d.ts +2 -2
- package/util/extractTag.js +12 -12
- package/util/getAuthorizationHeader.d.ts +2 -2
- package/util/getAuthorizationHeader.js +12 -12
- package/util/getGraph.d.ts +2 -2
- package/util/getGraph.js +8 -8
- package/util/getLocalStorageKey.d.ts +2 -2
- package/util/getLocalStorageKey.js +6 -6
- package/util/getOauth.d.ts +2 -2
- package/util/getOauth.js +50 -50
- package/util/getOauthAccounts.d.ts +2 -2
- package/util/getOauthAccounts.js +21 -21
- package/util/getRenderRoot.d.ts +2 -2
- package/util/getRenderRoot.js +11 -11
- package/util/getSettingIntFromTree.d.ts +7 -7
- package/util/getSettingIntFromTree.js +11 -11
- package/util/getSettingValueFromTree.d.ts +7 -7
- package/util/getSettingValueFromTree.js +13 -13
- package/util/getSettingValuesFromTree.d.ts +7 -7
- package/util/getSettingValuesFromTree.js +12 -12
- package/util/getSubTree.d.ts +8 -8
- package/util/getSubTree.js +19 -19
- package/util/getToken.d.ts +2 -2
- package/util/getToken.js +9 -9
- package/util/getTokenFromTree.d.ts +2 -2
- package/util/getTokenFromTree.js +5 -5
- package/util/idToTitle.d.ts +2 -2
- package/util/idToTitle.js +8 -8
- package/util/index.d.ts +23 -23
- package/util/index.js +52 -52
- package/util/isControl.d.ts +2 -2
- package/util/isControl.js +6 -6
- package/util/localStorageGet.d.ts +2 -2
- package/util/localStorageGet.js +8 -8
- package/util/localStorageRemove.d.ts +2 -2
- package/util/localStorageRemove.js +6 -6
- package/util/localStorageSet.d.ts +2 -2
- package/util/localStorageSet.js +8 -8
- package/util/registerSmartBlocksCommand.d.ts +8 -8
- package/util/registerSmartBlocksCommand.js +24 -24
- package/util/runExtension.d.ts +4 -4
- package/util/runExtension.js +40 -40
- package/util/setInputSetting.d.ts +7 -7
- package/util/setInputSetting.js +33 -33
- package/util/setInputSettings.d.ts +7 -7
- package/util/setInputSettings.js +28 -28
- package/util/toConfigPageName.d.ts +2 -2
- package/util/toConfigPageName.js +4 -4
- package/util/toFlexRegex.d.ts +2 -2
- package/util/toFlexRegex.js +4 -4
- package/writes/clearBlockById.d.ts +2 -2
- package/writes/clearBlockById.js +11 -11
- package/writes/clearBlockByUid.d.ts +2 -2
- package/writes/clearBlockByUid.js +9 -9
- package/writes/createBlock.d.ts +9 -9
- package/writes/createBlock.js +61 -61
- package/writes/createPage.d.ts +7 -7
- package/writes/createPage.js +18 -18
- package/writes/deleteBlock.d.ts +2 -2
- package/writes/deleteBlock.js +6 -6
- package/writes/index.d.ts +8 -8
- package/writes/index.js +22 -22
- package/writes/openBlockInSidebar.d.ts +2 -2
- package/writes/openBlockInSidebar.js +13 -13
- package/writes/updateActiveBlock.d.ts +2 -2
- package/writes/updateActiveBlock.js +11 -11
- package/writes/updateBlock.d.ts +5 -5
- package/writes/updateBlock.js +17 -17
package/types/index.d.ts
CHANGED
|
@@ -1,459 +1,461 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Condition as QueryBuilderCondition, Selection as QueryBuilderSelection, Result as QueryBuilderResult } from "./query-builder";
|
|
3
|
-
export declare type RoamBasicBlock = {
|
|
4
|
-
string: string;
|
|
5
|
-
uid: string;
|
|
6
|
-
};
|
|
7
|
-
export declare type RoamBasicPage = {
|
|
8
|
-
title: string;
|
|
9
|
-
uid: string;
|
|
10
|
-
};
|
|
11
|
-
export declare type RoamBasicNode = {
|
|
12
|
-
text: string;
|
|
13
|
-
uid: string;
|
|
14
|
-
children: RoamBasicNode[];
|
|
15
|
-
};
|
|
16
|
-
export declare type RoamUnorderedBasicNode = {
|
|
17
|
-
text: string;
|
|
18
|
-
uid: string;
|
|
19
|
-
order: number;
|
|
20
|
-
children?: RoamUnorderedBasicNode[];
|
|
21
|
-
};
|
|
22
|
-
export declare type RoamPull = {
|
|
23
|
-
"block/children"?: RoamNode[];
|
|
24
|
-
"block/heading"?: number;
|
|
25
|
-
"block/open"?: boolean;
|
|
26
|
-
"block/order"?: number;
|
|
27
|
-
"block/page"?: RoamNode;
|
|
28
|
-
"block/parents"?: RoamNode[];
|
|
29
|
-
"block/refs"?: RoamNode[];
|
|
30
|
-
"block/string"?: string;
|
|
31
|
-
"block/uid"?: string;
|
|
32
|
-
"children/view-type"?: `:${ViewType}`;
|
|
33
|
-
"create/time"?: number;
|
|
34
|
-
"create/user"?: RoamNode;
|
|
35
|
-
"edit/time"?: number;
|
|
36
|
-
"edit/user"?: RoamNode;
|
|
37
|
-
"log/id"?: number;
|
|
38
|
-
"node/title"?: string;
|
|
39
|
-
} & RoamNode;
|
|
40
|
-
export declare type PullBlock = {
|
|
41
|
-
":block/children"?: {
|
|
42
|
-
":db/id": number;
|
|
43
|
-
}[];
|
|
44
|
-
":block/heading"?: number;
|
|
45
|
-
":block/open"?: boolean;
|
|
46
|
-
":block/order"?: number;
|
|
47
|
-
":block/page"?: {
|
|
48
|
-
":db/id": number;
|
|
49
|
-
};
|
|
50
|
-
":block/parents"?: {
|
|
51
|
-
":db/id": number;
|
|
52
|
-
}[];
|
|
53
|
-
":block/props"?: {
|
|
54
|
-
":image-size"?: {
|
|
55
|
-
[p: string]: {
|
|
56
|
-
":height": number;
|
|
57
|
-
":width": number;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
":iframe"?: {
|
|
61
|
-
[p: string]: {
|
|
62
|
-
":size": {
|
|
63
|
-
":height": number;
|
|
64
|
-
":width": number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
":block/refs"?: {
|
|
70
|
-
":db/id": number;
|
|
71
|
-
}[];
|
|
72
|
-
":block/string"?: string;
|
|
73
|
-
":block/text-align"?: TextAlignment;
|
|
74
|
-
":block/uid"?: string;
|
|
75
|
-
":children/view-type"?: `:${ViewType}`;
|
|
76
|
-
":create/time"?: number;
|
|
77
|
-
":create/user"?: {
|
|
78
|
-
":db/id": number;
|
|
79
|
-
};
|
|
80
|
-
":edit/time"?: number;
|
|
81
|
-
":edit/user"?: {
|
|
82
|
-
":db/id": number;
|
|
83
|
-
};
|
|
84
|
-
":db/id"?: number;
|
|
85
|
-
":log/id"?: number;
|
|
86
|
-
":node/title"?: string;
|
|
87
|
-
":user/display-name"?: string;
|
|
88
|
-
":user/display-page"?: {
|
|
89
|
-
":db/id": number;
|
|
90
|
-
};
|
|
91
|
-
":user/settings"?: {
|
|
92
|
-
":namespace-options": [":none", ":partial", ":full"];
|
|
93
|
-
":link-brackets?": boolean;
|
|
94
|
-
":showing-inline-references?": boolean;
|
|
95
|
-
":right-sidebar-pinned": {
|
|
96
|
-
[uuid: string]: SidebarWindow;
|
|
97
|
-
};
|
|
98
|
-
":showing-own-icons?": boolean;
|
|
99
|
-
":showing-user-icons?": boolean;
|
|
100
|
-
};
|
|
101
|
-
":user/uid"?: string;
|
|
102
|
-
};
|
|
103
|
-
export declare type RoamPullResult = RoamPull | null;
|
|
104
|
-
export declare type ViewType = "document" | "bullet" | "numbered";
|
|
105
|
-
export declare type TextAlignment = "left" | "center" | "right";
|
|
106
|
-
export declare type RoamBlock = {
|
|
107
|
-
attrs?: {
|
|
108
|
-
source: string[];
|
|
109
|
-
}[][];
|
|
110
|
-
children?: {
|
|
111
|
-
id: number;
|
|
112
|
-
}[];
|
|
113
|
-
id?: number;
|
|
114
|
-
string?: string;
|
|
115
|
-
title?: string;
|
|
116
|
-
time?: number;
|
|
117
|
-
uid?: string;
|
|
118
|
-
order?: number;
|
|
119
|
-
"view-type"?: ViewType;
|
|
120
|
-
};
|
|
121
|
-
export declare type RoamError = {
|
|
122
|
-
raw: string;
|
|
123
|
-
"status-code": number;
|
|
124
|
-
};
|
|
125
|
-
export declare type TreeNode = {
|
|
126
|
-
text: string;
|
|
127
|
-
order: number;
|
|
128
|
-
children: TreeNode[];
|
|
129
|
-
uid: string;
|
|
130
|
-
heading: number;
|
|
131
|
-
open: boolean;
|
|
132
|
-
viewType: ViewType;
|
|
133
|
-
editTime: Date;
|
|
134
|
-
textAlign: TextAlignment;
|
|
135
|
-
props: {
|
|
136
|
-
imageResize: {
|
|
137
|
-
[link: string]: {
|
|
138
|
-
height: number;
|
|
139
|
-
width: number;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
iframe: {
|
|
143
|
-
[link: string]: {
|
|
144
|
-
height: number;
|
|
145
|
-
width: number;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
export declare type TextNode = {
|
|
151
|
-
text: string;
|
|
152
|
-
children: TextNode[];
|
|
153
|
-
};
|
|
154
|
-
export declare type InputTextNode = {
|
|
155
|
-
text: string;
|
|
156
|
-
children?: InputTextNode[];
|
|
157
|
-
uid?: string;
|
|
158
|
-
heading?: number;
|
|
159
|
-
textAlign?: TextAlignment;
|
|
160
|
-
viewType?: ViewType;
|
|
161
|
-
open?: boolean;
|
|
162
|
-
};
|
|
163
|
-
declare type PlusType = [number, string];
|
|
164
|
-
export declare type RoamNode = {
|
|
165
|
-
"db/id": number;
|
|
166
|
-
};
|
|
167
|
-
export declare type RoamQuery = RoamPull & {
|
|
168
|
-
"block/graph"?: RoamNode;
|
|
169
|
-
"node/graph+title"?: PlusType;
|
|
170
|
-
"block/graph+uid"?: PlusType;
|
|
171
|
-
"node/graph"?: RoamNode;
|
|
172
|
-
"edit/email"?: string;
|
|
173
|
-
"entity/graph"?: RoamNode;
|
|
174
|
-
};
|
|
175
|
-
export declare type RoamQueryResult = number & RoamQuery;
|
|
176
|
-
export declare type ClientParams = {
|
|
177
|
-
action: "pull" | "q" | "create-block" | "update-block" | "create-page" | "move-block" | "delete-block" | "delete-page" | "update-page";
|
|
178
|
-
selector?: string;
|
|
179
|
-
uid?: string;
|
|
180
|
-
query?: string;
|
|
181
|
-
inputs?: string[];
|
|
182
|
-
} & ActionParams;
|
|
183
|
-
declare type ActionParams = {
|
|
184
|
-
location?: {
|
|
185
|
-
"parent-uid": string;
|
|
186
|
-
order: number;
|
|
187
|
-
};
|
|
188
|
-
block?: {
|
|
189
|
-
string?: string;
|
|
190
|
-
uid?: string;
|
|
191
|
-
open?: boolean;
|
|
192
|
-
heading?: number;
|
|
193
|
-
"text-align"?: TextAlignment;
|
|
194
|
-
"children-view-type"?: ViewType;
|
|
195
|
-
};
|
|
196
|
-
page?: {
|
|
197
|
-
title?: string;
|
|
198
|
-
uid?: string;
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
export declare type WriteAction = (a: ActionParams) => Promise<void>;
|
|
202
|
-
export declare type UserSettings = {
|
|
203
|
-
"global-filters": {
|
|
204
|
-
includes: string[];
|
|
205
|
-
removes: string[];
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
declare type SidebarWindowType = SidebarBlockWindow | SidebarMentionsWindow | SidebarGraphWindow | SidebarOutlineWindow;
|
|
209
|
-
export declare type SidebarWindowInput = {
|
|
210
|
-
"block-uid": string;
|
|
211
|
-
type: SidebarWindowType["type"];
|
|
212
|
-
};
|
|
213
|
-
declare type SidebarBlockWindow = {
|
|
214
|
-
type: "block";
|
|
215
|
-
"block-uid": string;
|
|
216
|
-
};
|
|
217
|
-
declare type SidebarOutlineWindow = {
|
|
218
|
-
type: "outline";
|
|
219
|
-
"page-uid": string;
|
|
220
|
-
};
|
|
221
|
-
declare type SidebarMentionsWindow = {
|
|
222
|
-
type: "mentions";
|
|
223
|
-
"mentions-uid": string;
|
|
224
|
-
};
|
|
225
|
-
declare type SidebarGraphWindow = {
|
|
226
|
-
type: "graph";
|
|
227
|
-
"block-uid": string;
|
|
228
|
-
};
|
|
229
|
-
export declare type SidebarAction = (action: {
|
|
230
|
-
window: SidebarWindowInput;
|
|
231
|
-
}) => Promise<void>;
|
|
232
|
-
export declare type SidebarWindow = {
|
|
233
|
-
"collapsed?": boolean;
|
|
234
|
-
order: number;
|
|
235
|
-
"pinned?": boolean;
|
|
236
|
-
"window-id": string;
|
|
237
|
-
} & SidebarWindowType;
|
|
238
|
-
declare type json = string | number | boolean | null | {
|
|
239
|
-
toJSON: () => string;
|
|
240
|
-
} | json[] | {
|
|
241
|
-
[key: string]: json;
|
|
242
|
-
};
|
|
243
|
-
declare global {
|
|
244
|
-
interface Window {
|
|
245
|
-
roamAlphaAPI: {
|
|
246
|
-
q: (query: string, ...params: unknown[]) => any[][];
|
|
247
|
-
pull: (selector: string, id: number | string) => PullBlock;
|
|
248
|
-
createBlock: WriteAction;
|
|
249
|
-
updateBlock: WriteAction;
|
|
250
|
-
createPage: WriteAction;
|
|
251
|
-
moveBlock: WriteAction;
|
|
252
|
-
deleteBlock: WriteAction;
|
|
253
|
-
updatePage: WriteAction;
|
|
254
|
-
deletePage: WriteAction;
|
|
255
|
-
util: {
|
|
256
|
-
generateUID: () => string;
|
|
257
|
-
};
|
|
258
|
-
data: {
|
|
259
|
-
addPullWatch: (pullPattern: string, entityId: string, callback: (before: PullBlock, after: PullBlock) => void) => boolean;
|
|
260
|
-
block: {
|
|
261
|
-
create: WriteAction;
|
|
262
|
-
update: WriteAction;
|
|
263
|
-
move: WriteAction;
|
|
264
|
-
delete: WriteAction;
|
|
265
|
-
};
|
|
266
|
-
fast: {
|
|
267
|
-
q: (query: string, ...params: unknown[]) => unknown[][];
|
|
268
|
-
};
|
|
269
|
-
page: {
|
|
270
|
-
create: WriteAction;
|
|
271
|
-
update: WriteAction;
|
|
272
|
-
delete: WriteAction;
|
|
273
|
-
};
|
|
274
|
-
pull: (selector: string, id: number) => PullBlock;
|
|
275
|
-
pull_many: (pattern: string, eid: string[][]) => PullBlock[];
|
|
276
|
-
q: (query: string, ...params: unknown[]) => unknown[][];
|
|
277
|
-
removePullWatch: (pullPattern: string, entityId: string, callback: (before: PullBlock, after: PullBlock) => void) => boolean;
|
|
278
|
-
redo: () => void;
|
|
279
|
-
undo: () => void;
|
|
280
|
-
user: {
|
|
281
|
-
upsert: () => void;
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
ui: {
|
|
285
|
-
leftSidebar: {
|
|
286
|
-
open: () => Promise<void>;
|
|
287
|
-
close: () => Promise<void>;
|
|
288
|
-
};
|
|
289
|
-
rightSidebar: {
|
|
290
|
-
open: () => Promise<void>;
|
|
291
|
-
close: () => Promise<void>;
|
|
292
|
-
getWindows: () => SidebarWindow[];
|
|
293
|
-
addWindow: SidebarAction;
|
|
294
|
-
setWindowOrder: (action: {
|
|
295
|
-
window: SidebarWindowInput & {
|
|
296
|
-
order: number;
|
|
297
|
-
};
|
|
298
|
-
}) => Promise<void>;
|
|
299
|
-
collapseWindow: SidebarAction;
|
|
300
|
-
pinWindow: SidebarAction;
|
|
301
|
-
expandWindow: SidebarAction;
|
|
302
|
-
removeWindow: SidebarAction;
|
|
303
|
-
unpinWindow: SidebarAction;
|
|
304
|
-
};
|
|
305
|
-
commandPalette: {
|
|
306
|
-
addCommand: (action: {
|
|
307
|
-
label: string;
|
|
308
|
-
callback: () => void;
|
|
309
|
-
}) => void;
|
|
310
|
-
removeCommand: (action: {
|
|
311
|
-
label: string;
|
|
312
|
-
}) => void;
|
|
313
|
-
};
|
|
314
|
-
blockContextMenu: {
|
|
315
|
-
addCommand: (action: {
|
|
316
|
-
label: string;
|
|
317
|
-
callback: (props: {
|
|
318
|
-
"block-string": string;
|
|
319
|
-
"block-uid": string;
|
|
320
|
-
heading: 0 | 1 | 2 | 3 | null;
|
|
321
|
-
"page-uid": string;
|
|
322
|
-
"read-only?": boolean;
|
|
323
|
-
"window-id": string;
|
|
324
|
-
}) => void;
|
|
325
|
-
}) => void;
|
|
326
|
-
removeCommand: (action: {
|
|
327
|
-
label: string;
|
|
328
|
-
}) => void;
|
|
329
|
-
};
|
|
330
|
-
getFocusedBlock: () => null | {
|
|
331
|
-
"window-id": string;
|
|
332
|
-
"block-uid": string;
|
|
333
|
-
};
|
|
334
|
-
components: {
|
|
335
|
-
renderBlock: (args: {
|
|
336
|
-
uid: string;
|
|
337
|
-
el: HTMLElement;
|
|
338
|
-
}) => null;
|
|
339
|
-
};
|
|
340
|
-
mainWindow: {
|
|
341
|
-
openBlock: (p: {
|
|
342
|
-
block: {
|
|
343
|
-
uid: string;
|
|
344
|
-
};
|
|
345
|
-
}) => Promise<void>;
|
|
346
|
-
openPage: (p: {
|
|
347
|
-
page: {
|
|
348
|
-
uid: string;
|
|
349
|
-
} | {
|
|
350
|
-
title: string;
|
|
351
|
-
};
|
|
352
|
-
}) => Promise<void>;
|
|
353
|
-
getOpenPageOrBlockUid: () => string;
|
|
354
|
-
openDailyNotes: () => Promise<void>;
|
|
355
|
-
};
|
|
356
|
-
setBlockFocusAndSelection: (a: {
|
|
357
|
-
location?: {
|
|
358
|
-
"block-uid": string;
|
|
359
|
-
"window-id": string;
|
|
360
|
-
};
|
|
361
|
-
selection?: {
|
|
362
|
-
start: number;
|
|
363
|
-
end?: number;
|
|
364
|
-
};
|
|
365
|
-
}) => Promise<void>;
|
|
366
|
-
};
|
|
367
|
-
};
|
|
368
|
-
roamDatomicAlphaAPI?: (params: ClientParams) => Promise<RoamBlock & {
|
|
369
|
-
success?: boolean;
|
|
370
|
-
}>;
|
|
371
|
-
roamjs?: {
|
|
372
|
-
loaded: Set<string>;
|
|
373
|
-
extension: {
|
|
374
|
-
multiplayer?: {
|
|
375
|
-
addGraphListener: (args: {
|
|
376
|
-
operation: string;
|
|
377
|
-
handler: (e: json, graph: string) => void;
|
|
378
|
-
}) => void;
|
|
379
|
-
removeGraphListener: (args: {
|
|
380
|
-
operation: string;
|
|
381
|
-
}) => void;
|
|
382
|
-
sendToGraph: (args: {
|
|
383
|
-
graph: string;
|
|
384
|
-
operation: string;
|
|
385
|
-
data?: {
|
|
386
|
-
[k: string]: json;
|
|
387
|
-
};
|
|
388
|
-
}) => void;
|
|
389
|
-
getConnectedGraphs: () => string[];
|
|
390
|
-
getNetworkedGraphs: () => string[];
|
|
391
|
-
enable: () => void;
|
|
392
|
-
disable: () => void;
|
|
393
|
-
};
|
|
394
|
-
queryBuilder?: {
|
|
395
|
-
QueryEditor: (props: {
|
|
396
|
-
parentUid: string;
|
|
397
|
-
defaultQuery: string[];
|
|
398
|
-
onQuery: (query: {
|
|
399
|
-
returnNode: string;
|
|
400
|
-
conditions: QueryBuilderCondition[];
|
|
401
|
-
selections: QueryBuilderSelection[];
|
|
402
|
-
}) => Promise<void>;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Condition as QueryBuilderCondition, Selection as QueryBuilderSelection, Result as QueryBuilderResult } from "./query-builder";
|
|
3
|
+
export declare type RoamBasicBlock = {
|
|
4
|
+
string: string;
|
|
5
|
+
uid: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type RoamBasicPage = {
|
|
8
|
+
title: string;
|
|
9
|
+
uid: string;
|
|
10
|
+
};
|
|
11
|
+
export declare type RoamBasicNode = {
|
|
12
|
+
text: string;
|
|
13
|
+
uid: string;
|
|
14
|
+
children: RoamBasicNode[];
|
|
15
|
+
};
|
|
16
|
+
export declare type RoamUnorderedBasicNode = {
|
|
17
|
+
text: string;
|
|
18
|
+
uid: string;
|
|
19
|
+
order: number;
|
|
20
|
+
children?: RoamUnorderedBasicNode[];
|
|
21
|
+
};
|
|
22
|
+
export declare type RoamPull = {
|
|
23
|
+
"block/children"?: RoamNode[];
|
|
24
|
+
"block/heading"?: number;
|
|
25
|
+
"block/open"?: boolean;
|
|
26
|
+
"block/order"?: number;
|
|
27
|
+
"block/page"?: RoamNode;
|
|
28
|
+
"block/parents"?: RoamNode[];
|
|
29
|
+
"block/refs"?: RoamNode[];
|
|
30
|
+
"block/string"?: string;
|
|
31
|
+
"block/uid"?: string;
|
|
32
|
+
"children/view-type"?: `:${ViewType}`;
|
|
33
|
+
"create/time"?: number;
|
|
34
|
+
"create/user"?: RoamNode;
|
|
35
|
+
"edit/time"?: number;
|
|
36
|
+
"edit/user"?: RoamNode;
|
|
37
|
+
"log/id"?: number;
|
|
38
|
+
"node/title"?: string;
|
|
39
|
+
} & RoamNode;
|
|
40
|
+
export declare type PullBlock = {
|
|
41
|
+
":block/children"?: {
|
|
42
|
+
":db/id": number;
|
|
43
|
+
}[];
|
|
44
|
+
":block/heading"?: number;
|
|
45
|
+
":block/open"?: boolean;
|
|
46
|
+
":block/order"?: number;
|
|
47
|
+
":block/page"?: {
|
|
48
|
+
":db/id": number;
|
|
49
|
+
};
|
|
50
|
+
":block/parents"?: {
|
|
51
|
+
":db/id": number;
|
|
52
|
+
}[];
|
|
53
|
+
":block/props"?: {
|
|
54
|
+
":image-size"?: {
|
|
55
|
+
[p: string]: {
|
|
56
|
+
":height": number;
|
|
57
|
+
":width": number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
":iframe"?: {
|
|
61
|
+
[p: string]: {
|
|
62
|
+
":size": {
|
|
63
|
+
":height": number;
|
|
64
|
+
":width": number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
":block/refs"?: {
|
|
70
|
+
":db/id": number;
|
|
71
|
+
}[];
|
|
72
|
+
":block/string"?: string;
|
|
73
|
+
":block/text-align"?: TextAlignment;
|
|
74
|
+
":block/uid"?: string;
|
|
75
|
+
":children/view-type"?: `:${ViewType}`;
|
|
76
|
+
":create/time"?: number;
|
|
77
|
+
":create/user"?: {
|
|
78
|
+
":db/id": number;
|
|
79
|
+
};
|
|
80
|
+
":edit/time"?: number;
|
|
81
|
+
":edit/user"?: {
|
|
82
|
+
":db/id": number;
|
|
83
|
+
};
|
|
84
|
+
":db/id"?: number;
|
|
85
|
+
":log/id"?: number;
|
|
86
|
+
":node/title"?: string;
|
|
87
|
+
":user/display-name"?: string;
|
|
88
|
+
":user/display-page"?: {
|
|
89
|
+
":db/id": number;
|
|
90
|
+
};
|
|
91
|
+
":user/settings"?: {
|
|
92
|
+
":namespace-options": [":none", ":partial", ":full"];
|
|
93
|
+
":link-brackets?": boolean;
|
|
94
|
+
":showing-inline-references?": boolean;
|
|
95
|
+
":right-sidebar-pinned": {
|
|
96
|
+
[uuid: string]: SidebarWindow;
|
|
97
|
+
};
|
|
98
|
+
":showing-own-icons?": boolean;
|
|
99
|
+
":showing-user-icons?": boolean;
|
|
100
|
+
};
|
|
101
|
+
":user/uid"?: string;
|
|
102
|
+
};
|
|
103
|
+
export declare type RoamPullResult = RoamPull | null;
|
|
104
|
+
export declare type ViewType = "document" | "bullet" | "numbered";
|
|
105
|
+
export declare type TextAlignment = "left" | "center" | "right";
|
|
106
|
+
export declare type RoamBlock = {
|
|
107
|
+
attrs?: {
|
|
108
|
+
source: string[];
|
|
109
|
+
}[][];
|
|
110
|
+
children?: {
|
|
111
|
+
id: number;
|
|
112
|
+
}[];
|
|
113
|
+
id?: number;
|
|
114
|
+
string?: string;
|
|
115
|
+
title?: string;
|
|
116
|
+
time?: number;
|
|
117
|
+
uid?: string;
|
|
118
|
+
order?: number;
|
|
119
|
+
"view-type"?: ViewType;
|
|
120
|
+
};
|
|
121
|
+
export declare type RoamError = {
|
|
122
|
+
raw: string;
|
|
123
|
+
"status-code": number;
|
|
124
|
+
};
|
|
125
|
+
export declare type TreeNode = {
|
|
126
|
+
text: string;
|
|
127
|
+
order: number;
|
|
128
|
+
children: TreeNode[];
|
|
129
|
+
uid: string;
|
|
130
|
+
heading: number;
|
|
131
|
+
open: boolean;
|
|
132
|
+
viewType: ViewType;
|
|
133
|
+
editTime: Date;
|
|
134
|
+
textAlign: TextAlignment;
|
|
135
|
+
props: {
|
|
136
|
+
imageResize: {
|
|
137
|
+
[link: string]: {
|
|
138
|
+
height: number;
|
|
139
|
+
width: number;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
iframe: {
|
|
143
|
+
[link: string]: {
|
|
144
|
+
height: number;
|
|
145
|
+
width: number;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export declare type TextNode = {
|
|
151
|
+
text: string;
|
|
152
|
+
children: TextNode[];
|
|
153
|
+
};
|
|
154
|
+
export declare type InputTextNode = {
|
|
155
|
+
text: string;
|
|
156
|
+
children?: InputTextNode[];
|
|
157
|
+
uid?: string;
|
|
158
|
+
heading?: number;
|
|
159
|
+
textAlign?: TextAlignment;
|
|
160
|
+
viewType?: ViewType;
|
|
161
|
+
open?: boolean;
|
|
162
|
+
};
|
|
163
|
+
declare type PlusType = [number, string];
|
|
164
|
+
export declare type RoamNode = {
|
|
165
|
+
"db/id": number;
|
|
166
|
+
};
|
|
167
|
+
export declare type RoamQuery = RoamPull & {
|
|
168
|
+
"block/graph"?: RoamNode;
|
|
169
|
+
"node/graph+title"?: PlusType;
|
|
170
|
+
"block/graph+uid"?: PlusType;
|
|
171
|
+
"node/graph"?: RoamNode;
|
|
172
|
+
"edit/email"?: string;
|
|
173
|
+
"entity/graph"?: RoamNode;
|
|
174
|
+
};
|
|
175
|
+
export declare type RoamQueryResult = number & RoamQuery;
|
|
176
|
+
export declare type ClientParams = {
|
|
177
|
+
action: "pull" | "q" | "create-block" | "update-block" | "create-page" | "move-block" | "delete-block" | "delete-page" | "update-page";
|
|
178
|
+
selector?: string;
|
|
179
|
+
uid?: string;
|
|
180
|
+
query?: string;
|
|
181
|
+
inputs?: string[];
|
|
182
|
+
} & ActionParams;
|
|
183
|
+
declare type ActionParams = {
|
|
184
|
+
location?: {
|
|
185
|
+
"parent-uid": string;
|
|
186
|
+
order: number;
|
|
187
|
+
};
|
|
188
|
+
block?: {
|
|
189
|
+
string?: string;
|
|
190
|
+
uid?: string;
|
|
191
|
+
open?: boolean;
|
|
192
|
+
heading?: number;
|
|
193
|
+
"text-align"?: TextAlignment;
|
|
194
|
+
"children-view-type"?: ViewType;
|
|
195
|
+
};
|
|
196
|
+
page?: {
|
|
197
|
+
title?: string;
|
|
198
|
+
uid?: string;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
export declare type WriteAction = (a: ActionParams) => Promise<void>;
|
|
202
|
+
export declare type UserSettings = {
|
|
203
|
+
"global-filters": {
|
|
204
|
+
includes: string[];
|
|
205
|
+
removes: string[];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
declare type SidebarWindowType = SidebarBlockWindow | SidebarMentionsWindow | SidebarGraphWindow | SidebarOutlineWindow;
|
|
209
|
+
export declare type SidebarWindowInput = {
|
|
210
|
+
"block-uid": string;
|
|
211
|
+
type: SidebarWindowType["type"];
|
|
212
|
+
};
|
|
213
|
+
declare type SidebarBlockWindow = {
|
|
214
|
+
type: "block";
|
|
215
|
+
"block-uid": string;
|
|
216
|
+
};
|
|
217
|
+
declare type SidebarOutlineWindow = {
|
|
218
|
+
type: "outline";
|
|
219
|
+
"page-uid": string;
|
|
220
|
+
};
|
|
221
|
+
declare type SidebarMentionsWindow = {
|
|
222
|
+
type: "mentions";
|
|
223
|
+
"mentions-uid": string;
|
|
224
|
+
};
|
|
225
|
+
declare type SidebarGraphWindow = {
|
|
226
|
+
type: "graph";
|
|
227
|
+
"block-uid": string;
|
|
228
|
+
};
|
|
229
|
+
export declare type SidebarAction = (action: {
|
|
230
|
+
window: SidebarWindowInput;
|
|
231
|
+
}) => Promise<void>;
|
|
232
|
+
export declare type SidebarWindow = {
|
|
233
|
+
"collapsed?": boolean;
|
|
234
|
+
order: number;
|
|
235
|
+
"pinned?": boolean;
|
|
236
|
+
"window-id": string;
|
|
237
|
+
} & SidebarWindowType;
|
|
238
|
+
declare type json = string | number | boolean | null | {
|
|
239
|
+
toJSON: () => string;
|
|
240
|
+
} | json[] | {
|
|
241
|
+
[key: string]: json;
|
|
242
|
+
};
|
|
243
|
+
declare global {
|
|
244
|
+
interface Window {
|
|
245
|
+
roamAlphaAPI: {
|
|
246
|
+
q: (query: string, ...params: unknown[]) => any[][];
|
|
247
|
+
pull: (selector: string, id: number | string) => PullBlock;
|
|
248
|
+
createBlock: WriteAction;
|
|
249
|
+
updateBlock: WriteAction;
|
|
250
|
+
createPage: WriteAction;
|
|
251
|
+
moveBlock: WriteAction;
|
|
252
|
+
deleteBlock: WriteAction;
|
|
253
|
+
updatePage: WriteAction;
|
|
254
|
+
deletePage: WriteAction;
|
|
255
|
+
util: {
|
|
256
|
+
generateUID: () => string;
|
|
257
|
+
};
|
|
258
|
+
data: {
|
|
259
|
+
addPullWatch: (pullPattern: string, entityId: string, callback: (before: PullBlock, after: PullBlock) => void) => boolean;
|
|
260
|
+
block: {
|
|
261
|
+
create: WriteAction;
|
|
262
|
+
update: WriteAction;
|
|
263
|
+
move: WriteAction;
|
|
264
|
+
delete: WriteAction;
|
|
265
|
+
};
|
|
266
|
+
fast: {
|
|
267
|
+
q: (query: string, ...params: unknown[]) => unknown[][];
|
|
268
|
+
};
|
|
269
|
+
page: {
|
|
270
|
+
create: WriteAction;
|
|
271
|
+
update: WriteAction;
|
|
272
|
+
delete: WriteAction;
|
|
273
|
+
};
|
|
274
|
+
pull: (selector: string, id: number) => PullBlock;
|
|
275
|
+
pull_many: (pattern: string, eid: string[][]) => PullBlock[];
|
|
276
|
+
q: (query: string, ...params: unknown[]) => unknown[][];
|
|
277
|
+
removePullWatch: (pullPattern: string, entityId: string, callback: (before: PullBlock, after: PullBlock) => void) => boolean;
|
|
278
|
+
redo: () => void;
|
|
279
|
+
undo: () => void;
|
|
280
|
+
user: {
|
|
281
|
+
upsert: () => void;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
ui: {
|
|
285
|
+
leftSidebar: {
|
|
286
|
+
open: () => Promise<void>;
|
|
287
|
+
close: () => Promise<void>;
|
|
288
|
+
};
|
|
289
|
+
rightSidebar: {
|
|
290
|
+
open: () => Promise<void>;
|
|
291
|
+
close: () => Promise<void>;
|
|
292
|
+
getWindows: () => SidebarWindow[];
|
|
293
|
+
addWindow: SidebarAction;
|
|
294
|
+
setWindowOrder: (action: {
|
|
295
|
+
window: SidebarWindowInput & {
|
|
296
|
+
order: number;
|
|
297
|
+
};
|
|
298
|
+
}) => Promise<void>;
|
|
299
|
+
collapseWindow: SidebarAction;
|
|
300
|
+
pinWindow: SidebarAction;
|
|
301
|
+
expandWindow: SidebarAction;
|
|
302
|
+
removeWindow: SidebarAction;
|
|
303
|
+
unpinWindow: SidebarAction;
|
|
304
|
+
};
|
|
305
|
+
commandPalette: {
|
|
306
|
+
addCommand: (action: {
|
|
307
|
+
label: string;
|
|
308
|
+
callback: () => void;
|
|
309
|
+
}) => void;
|
|
310
|
+
removeCommand: (action: {
|
|
311
|
+
label: string;
|
|
312
|
+
}) => void;
|
|
313
|
+
};
|
|
314
|
+
blockContextMenu: {
|
|
315
|
+
addCommand: (action: {
|
|
316
|
+
label: string;
|
|
317
|
+
callback: (props: {
|
|
318
|
+
"block-string": string;
|
|
319
|
+
"block-uid": string;
|
|
320
|
+
heading: 0 | 1 | 2 | 3 | null;
|
|
321
|
+
"page-uid": string;
|
|
322
|
+
"read-only?": boolean;
|
|
323
|
+
"window-id": string;
|
|
324
|
+
}) => void;
|
|
325
|
+
}) => void;
|
|
326
|
+
removeCommand: (action: {
|
|
327
|
+
label: string;
|
|
328
|
+
}) => void;
|
|
329
|
+
};
|
|
330
|
+
getFocusedBlock: () => null | {
|
|
331
|
+
"window-id": string;
|
|
332
|
+
"block-uid": string;
|
|
333
|
+
};
|
|
334
|
+
components: {
|
|
335
|
+
renderBlock: (args: {
|
|
336
|
+
uid: string;
|
|
337
|
+
el: HTMLElement;
|
|
338
|
+
}) => null;
|
|
339
|
+
};
|
|
340
|
+
mainWindow: {
|
|
341
|
+
openBlock: (p: {
|
|
342
|
+
block: {
|
|
343
|
+
uid: string;
|
|
344
|
+
};
|
|
345
|
+
}) => Promise<void>;
|
|
346
|
+
openPage: (p: {
|
|
347
|
+
page: {
|
|
348
|
+
uid: string;
|
|
349
|
+
} | {
|
|
350
|
+
title: string;
|
|
351
|
+
};
|
|
352
|
+
}) => Promise<void>;
|
|
353
|
+
getOpenPageOrBlockUid: () => string;
|
|
354
|
+
openDailyNotes: () => Promise<void>;
|
|
355
|
+
};
|
|
356
|
+
setBlockFocusAndSelection: (a: {
|
|
357
|
+
location?: {
|
|
358
|
+
"block-uid": string;
|
|
359
|
+
"window-id": string;
|
|
360
|
+
};
|
|
361
|
+
selection?: {
|
|
362
|
+
start: number;
|
|
363
|
+
end?: number;
|
|
364
|
+
};
|
|
365
|
+
}) => Promise<void>;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
roamDatomicAlphaAPI?: (params: ClientParams) => Promise<RoamBlock & {
|
|
369
|
+
success?: boolean;
|
|
370
|
+
}>;
|
|
371
|
+
roamjs?: {
|
|
372
|
+
loaded: Set<string>;
|
|
373
|
+
extension: {
|
|
374
|
+
multiplayer?: {
|
|
375
|
+
addGraphListener: (args: {
|
|
376
|
+
operation: string;
|
|
377
|
+
handler: (e: json, graph: string) => void;
|
|
378
|
+
}) => void;
|
|
379
|
+
removeGraphListener: (args: {
|
|
380
|
+
operation: string;
|
|
381
|
+
}) => void;
|
|
382
|
+
sendToGraph: (args: {
|
|
383
|
+
graph: string;
|
|
384
|
+
operation: string;
|
|
385
|
+
data?: {
|
|
386
|
+
[k: string]: json;
|
|
387
|
+
};
|
|
388
|
+
}) => void;
|
|
389
|
+
getConnectedGraphs: () => string[];
|
|
390
|
+
getNetworkedGraphs: () => string[];
|
|
391
|
+
enable: () => void;
|
|
392
|
+
disable: () => void;
|
|
393
|
+
};
|
|
394
|
+
queryBuilder?: {
|
|
395
|
+
QueryEditor: (props: {
|
|
396
|
+
parentUid: string;
|
|
397
|
+
defaultQuery: string[];
|
|
398
|
+
onQuery: (query: {
|
|
399
|
+
returnNode: string;
|
|
400
|
+
conditions: QueryBuilderCondition[];
|
|
401
|
+
selections: QueryBuilderSelection[];
|
|
402
|
+
}) => Promise<void>;
|
|
403
|
+
defaultReturnNode?: string;
|
|
404
|
+
}) => JSX.Element;
|
|
405
|
+
QueryPage: (props: {
|
|
406
|
+
pageUid: string;
|
|
407
|
+
configUid?: string;
|
|
408
|
+
}) => JSX.Element;
|
|
409
|
+
ResultsView: (props: {
|
|
410
|
+
parentUid: string;
|
|
411
|
+
header?: React.ReactNode;
|
|
412
|
+
results: QueryBuilderResult[];
|
|
413
|
+
resultContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
414
|
+
hideResults?: boolean;
|
|
415
|
+
resultFilter?: (r: QueryBuilderResult) => boolean;
|
|
416
|
+
ctrlClick?: (r: QueryBuilderResult) => void;
|
|
417
|
+
}) => JSX.Element;
|
|
418
|
+
fireQuery: (query: {
|
|
419
|
+
returnNode: string;
|
|
420
|
+
conditions: QueryBuilderCondition[];
|
|
421
|
+
selections: QueryBuilderSelection[];
|
|
422
|
+
}) => QueryBuilderResult[];
|
|
423
|
+
parseQuery: (q: string[]) => {
|
|
424
|
+
returnNode: string;
|
|
425
|
+
conditionNodes: QueryBuilderCondition[];
|
|
426
|
+
selectionNodes: QueryBuilderSelection[];
|
|
427
|
+
};
|
|
428
|
+
conditionToDatalog: (condition: QueryBuilderCondition) => string;
|
|
429
|
+
registerDatalogTranslator: (args: {
|
|
430
|
+
key: string;
|
|
431
|
+
callback: (args: {
|
|
432
|
+
freeVar: (s: string) => string;
|
|
433
|
+
source: string;
|
|
434
|
+
target: string;
|
|
435
|
+
uid: string;
|
|
436
|
+
}) => string;
|
|
437
|
+
}) => void;
|
|
438
|
+
unregisterDatalogTranslator: (args: {
|
|
439
|
+
key: string;
|
|
440
|
+
}) => void;
|
|
441
|
+
registerSelection: (args: {
|
|
442
|
+
test: RegExp;
|
|
443
|
+
pull: (a: {
|
|
444
|
+
returnNode: string;
|
|
445
|
+
match: RegExpExecArray;
|
|
446
|
+
}) => string;
|
|
447
|
+
mapper: (r: PullBlock, key: string) => QueryBuilderResult[string];
|
|
448
|
+
}) => void;
|
|
449
|
+
};
|
|
450
|
+
[id: string]: {
|
|
451
|
+
[method: string]: (args?: any) => void;
|
|
452
|
+
} | undefined;
|
|
453
|
+
};
|
|
454
|
+
version: {
|
|
455
|
+
[id: string]: string;
|
|
456
|
+
};
|
|
457
|
+
dynamicElements: Set<HTMLElement>;
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
export {};
|