@itwin/appui-abstract 4.0.0-dev.48 → 4.0.0-dev.51
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/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +30 -30
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +79 -79
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/UiAdmin.d.ts +221 -221
- package/lib/cjs/appui-abstract/UiAdmin.js +224 -224
- package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts +113 -113
- package/lib/cjs/appui-abstract/UiItemsManager.js +193 -193
- package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +29 -29
- package/lib/cjs/appui-abstract/UiItemsProvider.js +9 -9
- package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts +91 -91
- package/lib/cjs/appui-abstract/backstage/BackstageItem.js +70 -70
- package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -1
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.d.ts +38 -38
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js +133 -133
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/common/KeyboardKey.d.ts +51 -51
- package/lib/cjs/appui-abstract/common/KeyboardKey.js +63 -63
- package/lib/cjs/appui-abstract/common/KeyboardKey.js.map +1 -1
- package/lib/cjs/appui-abstract/content/ContentLayoutProps.d.ts +62 -62
- package/lib/cjs/appui-abstract/content/ContentLayoutProps.js +9 -9
- package/lib/cjs/appui-abstract/content/ContentLayoutProps.js.map +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.d.ts +19 -19
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js +108 -108
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts +76 -76
- package/lib/cjs/appui-abstract/dialogs/DialogItem.js +67 -67
- package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/UiDataProvider.d.ts +55 -55
- package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js +66 -66
- package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.d.ts +97 -97
- package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js +175 -175
- package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractItemProps.d.ts +53 -53
- package/lib/cjs/appui-abstract/items/AbstractItemProps.js +9 -9
- package/lib/cjs/appui-abstract/items/AbstractItemProps.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.d.ts +20 -20
- package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.js +9 -9
- package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractToolbarProps.d.ts +13 -13
- package/lib/cjs/appui-abstract/items/AbstractToolbarProps.js +9 -9
- package/lib/cjs/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
- package/lib/cjs/appui-abstract/items/BadgeType.d.ts +14 -14
- package/lib/cjs/appui-abstract/items/BadgeType.js +22 -22
- package/lib/cjs/appui-abstract/items/BadgeType.js.map +1 -1
- package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.d.ts +27 -27
- package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js +60 -60
- package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
- package/lib/cjs/appui-abstract/items/ConditionalStringValue.d.ts +29 -29
- package/lib/cjs/appui-abstract/items/ConditionalStringValue.js +62 -62
- package/lib/cjs/appui-abstract/items/ConditionalStringValue.js.map +1 -1
- package/lib/cjs/appui-abstract/items/ProvidedItem.d.ts +11 -11
- package/lib/cjs/appui-abstract/items/ProvidedItem.js +9 -9
- package/lib/cjs/appui-abstract/items/ProvidedItem.js.map +1 -1
- package/lib/cjs/appui-abstract/items/RelativePosition.d.ts +18 -18
- package/lib/cjs/appui-abstract/items/RelativePosition.js +26 -26
- package/lib/cjs/appui-abstract/items/RelativePosition.js.map +1 -1
- package/lib/cjs/appui-abstract/items/StageUsage.d.ts +16 -16
- package/lib/cjs/appui-abstract/items/StageUsage.js +24 -24
- package/lib/cjs/appui-abstract/items/StageUsage.js.map +1 -1
- package/lib/cjs/appui-abstract/notification/MessagePresenter.d.ts +42 -42
- package/lib/cjs/appui-abstract/notification/MessagePresenter.js +24 -24
- package/lib/cjs/appui-abstract/notification/MessagePresenter.js.map +1 -1
- package/lib/cjs/appui-abstract/notification/MessageSeverity.d.ts +15 -15
- package/lib/cjs/appui-abstract/notification/MessageSeverity.js +23 -23
- package/lib/cjs/appui-abstract/notification/MessageSeverity.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/Description.d.ts +127 -127
- package/lib/cjs/appui-abstract/properties/Description.js +196 -196
- package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/EditorParams.d.ts +260 -260
- package/lib/cjs/appui-abstract/properties/EditorParams.js +106 -106
- package/lib/cjs/appui-abstract/properties/EditorParams.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/PrimitiveTypes.d.ts +60 -60
- package/lib/cjs/appui-abstract/properties/PrimitiveTypes.js +9 -9
- package/lib/cjs/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/Record.d.ts +57 -57
- package/lib/cjs/appui-abstract/properties/Record.js +78 -78
- package/lib/cjs/appui-abstract/properties/Record.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/StandardEditorNames.d.ts +22 -22
- package/lib/cjs/appui-abstract/properties/StandardEditorNames.js +30 -30
- package/lib/cjs/appui-abstract/properties/StandardEditorNames.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/StandardTypeNames.d.ts +30 -30
- package/lib/cjs/appui-abstract/properties/StandardTypeNames.js +39 -39
- package/lib/cjs/appui-abstract/properties/StandardTypeNames.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/Value.d.ts +49 -49
- package/lib/cjs/appui-abstract/properties/Value.js +20 -20
- package/lib/cjs/appui-abstract/properties/Value.js.map +1 -1
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.d.ts +22 -22
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js +48 -48
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts +128 -128
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js +87 -87
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.d.ts +39 -39
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js +135 -135
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts +121 -121
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js +64 -64
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.d.ts +45 -45
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js +235 -235
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts +29 -29
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js +51 -51
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/PointProps.d.ts +10 -10
- package/lib/cjs/appui-abstract/utils/PointProps.js +9 -9
- package/lib/cjs/appui-abstract/utils/PointProps.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiError.d.ts +12 -12
- package/lib/cjs/appui-abstract/utils/UiError.js +22 -22
- package/lib/cjs/appui-abstract/utils/UiError.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiEvent.d.ts +9 -9
- package/lib/cjs/appui-abstract/utils/UiEvent.js +17 -17
- package/lib/cjs/appui-abstract/utils/UiEvent.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.d.ts +46 -46
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js +131 -131
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/callbacks.d.ts +20 -20
- package/lib/cjs/appui-abstract/utils/callbacks.js +9 -9
- package/lib/cjs/appui-abstract/utils/callbacks.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/charCode.d.ts +416 -416
- package/lib/cjs/appui-abstract/utils/filter/charCode.js +6 -6
- package/lib/cjs/appui-abstract/utils/filter/charCode.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/filters.d.ts +98 -98
- package/lib/cjs/appui-abstract/utils/filter/filters.js +709 -709
- package/lib/cjs/appui-abstract/utils/filter/filters.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/map.d.ts +59 -59
- package/lib/cjs/appui-abstract/utils/filter/map.js +402 -402
- package/lib/cjs/appui-abstract/utils/filter/map.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/strings.d.ts +20 -20
- package/lib/cjs/appui-abstract/utils/filter/strings.js +78 -78
- package/lib/cjs/appui-abstract/utils/filter/strings.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/isLetter.d.ts +9 -9
- package/lib/cjs/appui-abstract/utils/isLetter.js +19 -19
- package/lib/cjs/appui-abstract/utils/isLetter.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/misc.d.ts +11 -11
- package/lib/cjs/appui-abstract/utils/misc.js +36 -36
- package/lib/cjs/appui-abstract/utils/misc.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +86 -86
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js +9 -9
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts +36 -36
- package/lib/cjs/appui-abstract/widget/StagePanel.js +46 -46
- package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/WidgetState.d.ts +19 -19
- package/lib/cjs/appui-abstract/widget/WidgetState.js +27 -27
- package/lib/cjs/appui-abstract/widget/WidgetState.js.map +1 -1
- package/lib/cjs/appui-abstract.d.ts +103 -103
- package/lib/cjs/appui-abstract.js +119 -119
- package/lib/cjs/appui-abstract.js.map +1 -1
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +30 -30
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js +75 -75
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-abstract/UiAdmin.d.ts +221 -221
- package/lib/esm/appui-abstract/UiAdmin.js +219 -219
- package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.d.ts +113 -113
- package/lib/esm/appui-abstract/UiItemsManager.js +189 -189
- package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts +29 -29
- package/lib/esm/appui-abstract/UiItemsProvider.js +8 -8
- package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -1
- package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts +91 -91
- package/lib/esm/appui-abstract/backstage/BackstageItem.js +64 -64
- package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -1
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.d.ts +38 -38
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js +129 -129
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/common/KeyboardKey.d.ts +51 -51
- package/lib/esm/appui-abstract/common/KeyboardKey.js +59 -59
- package/lib/esm/appui-abstract/common/KeyboardKey.js.map +1 -1
- package/lib/esm/appui-abstract/content/ContentLayoutProps.d.ts +62 -62
- package/lib/esm/appui-abstract/content/ContentLayoutProps.js +8 -8
- package/lib/esm/appui-abstract/content/ContentLayoutProps.js.map +1 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.d.ts +19 -19
- package/lib/esm/appui-abstract/content/StandardContentLayouts.js +104 -104
- package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts +76 -76
- package/lib/esm/appui-abstract/dialogs/DialogItem.js +63 -63
- package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/UiDataProvider.d.ts +55 -55
- package/lib/esm/appui-abstract/dialogs/UiDataProvider.js +61 -61
- package/lib/esm/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.d.ts +97 -97
- package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js +170 -170
- package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractItemProps.d.ts +53 -53
- package/lib/esm/appui-abstract/items/AbstractItemProps.js +8 -8
- package/lib/esm/appui-abstract/items/AbstractItemProps.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractMenuItemProps.d.ts +20 -20
- package/lib/esm/appui-abstract/items/AbstractMenuItemProps.js +8 -8
- package/lib/esm/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractToolbarProps.d.ts +13 -13
- package/lib/esm/appui-abstract/items/AbstractToolbarProps.js +8 -8
- package/lib/esm/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
- package/lib/esm/appui-abstract/items/BadgeType.d.ts +14 -14
- package/lib/esm/appui-abstract/items/BadgeType.js +19 -19
- package/lib/esm/appui-abstract/items/BadgeType.js.map +1 -1
- package/lib/esm/appui-abstract/items/ConditionalBooleanValue.d.ts +27 -27
- package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js +56 -56
- package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
- package/lib/esm/appui-abstract/items/ConditionalStringValue.d.ts +29 -29
- package/lib/esm/appui-abstract/items/ConditionalStringValue.js +58 -58
- package/lib/esm/appui-abstract/items/ConditionalStringValue.js.map +1 -1
- package/lib/esm/appui-abstract/items/ProvidedItem.d.ts +11 -11
- package/lib/esm/appui-abstract/items/ProvidedItem.js +8 -8
- package/lib/esm/appui-abstract/items/ProvidedItem.js.map +1 -1
- package/lib/esm/appui-abstract/items/RelativePosition.d.ts +18 -18
- package/lib/esm/appui-abstract/items/RelativePosition.js +23 -23
- package/lib/esm/appui-abstract/items/RelativePosition.js.map +1 -1
- package/lib/esm/appui-abstract/items/StageUsage.d.ts +16 -16
- package/lib/esm/appui-abstract/items/StageUsage.js +21 -21
- package/lib/esm/appui-abstract/items/StageUsage.js.map +1 -1
- package/lib/esm/appui-abstract/notification/MessagePresenter.d.ts +42 -42
- package/lib/esm/appui-abstract/notification/MessagePresenter.js +21 -21
- package/lib/esm/appui-abstract/notification/MessagePresenter.js.map +1 -1
- package/lib/esm/appui-abstract/notification/MessageSeverity.d.ts +15 -15
- package/lib/esm/appui-abstract/notification/MessageSeverity.js +20 -20
- package/lib/esm/appui-abstract/notification/MessageSeverity.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Description.d.ts +127 -127
- package/lib/esm/appui-abstract/properties/Description.js +192 -192
- package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
- package/lib/esm/appui-abstract/properties/EditorParams.d.ts +260 -260
- package/lib/esm/appui-abstract/properties/EditorParams.js +97 -97
- package/lib/esm/appui-abstract/properties/EditorParams.js.map +1 -1
- package/lib/esm/appui-abstract/properties/PrimitiveTypes.d.ts +60 -60
- package/lib/esm/appui-abstract/properties/PrimitiveTypes.js +8 -8
- package/lib/esm/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Record.d.ts +57 -57
- package/lib/esm/appui-abstract/properties/Record.js +74 -74
- package/lib/esm/appui-abstract/properties/Record.js.map +1 -1
- package/lib/esm/appui-abstract/properties/StandardEditorNames.d.ts +22 -22
- package/lib/esm/appui-abstract/properties/StandardEditorNames.js +27 -27
- package/lib/esm/appui-abstract/properties/StandardEditorNames.js.map +1 -1
- package/lib/esm/appui-abstract/properties/StandardTypeNames.d.ts +30 -30
- package/lib/esm/appui-abstract/properties/StandardTypeNames.js +36 -36
- package/lib/esm/appui-abstract/properties/StandardTypeNames.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Value.d.ts +49 -49
- package/lib/esm/appui-abstract/properties/Value.js +17 -17
- package/lib/esm/appui-abstract/properties/Value.js.map +1 -1
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.d.ts +22 -22
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js +44 -44
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts +128 -128
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.js +80 -80
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.d.ts +39 -39
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js +131 -131
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts +121 -121
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.js +60 -60
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.d.ts +45 -45
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js +231 -231
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts +29 -29
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js +47 -47
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/esm/appui-abstract/utils/PointProps.d.ts +10 -10
- package/lib/esm/appui-abstract/utils/PointProps.js +8 -8
- package/lib/esm/appui-abstract/utils/PointProps.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiError.d.ts +12 -12
- package/lib/esm/appui-abstract/utils/UiError.js +18 -18
- package/lib/esm/appui-abstract/utils/UiError.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiEvent.d.ts +9 -9
- package/lib/esm/appui-abstract/utils/UiEvent.js +13 -13
- package/lib/esm/appui-abstract/utils/UiEvent.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.d.ts +46 -46
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.js +126 -126
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
- package/lib/esm/appui-abstract/utils/callbacks.d.ts +20 -20
- package/lib/esm/appui-abstract/utils/callbacks.js +8 -8
- package/lib/esm/appui-abstract/utils/callbacks.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/charCode.d.ts +416 -416
- package/lib/esm/appui-abstract/utils/filter/charCode.js +5 -5
- package/lib/esm/appui-abstract/utils/filter/charCode.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/filters.d.ts +98 -98
- package/lib/esm/appui-abstract/utils/filter/filters.js +694 -694
- package/lib/esm/appui-abstract/utils/filter/filters.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/map.d.ts +59 -59
- package/lib/esm/appui-abstract/utils/filter/map.js +397 -397
- package/lib/esm/appui-abstract/utils/filter/map.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/strings.d.ts +20 -20
- package/lib/esm/appui-abstract/utils/filter/strings.js +70 -70
- package/lib/esm/appui-abstract/utils/filter/strings.js.map +1 -1
- package/lib/esm/appui-abstract/utils/isLetter.d.ts +9 -9
- package/lib/esm/appui-abstract/utils/isLetter.js +15 -15
- package/lib/esm/appui-abstract/utils/isLetter.js.map +1 -1
- package/lib/esm/appui-abstract/utils/misc.d.ts +11 -11
- package/lib/esm/appui-abstract/utils/misc.js +31 -31
- package/lib/esm/appui-abstract/utils/misc.js.map +1 -1
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +86 -86
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js +8 -8
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts +36 -36
- package/lib/esm/appui-abstract/widget/StagePanel.js +43 -43
- package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
- package/lib/esm/appui-abstract/widget/WidgetState.d.ts +19 -19
- package/lib/esm/appui-abstract/widget/WidgetState.js +24 -24
- package/lib/esm/appui-abstract/widget/WidgetState.js.map +1 -1
- package/lib/esm/appui-abstract.d.ts +103 -103
- package/lib/esm/appui-abstract.js +107 -107
- package/lib/esm/appui-abstract.js.map +1 -1
- package/package.json +4 -4
@@ -1,398 +1,398 @@
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
5
|
-
var _a;
|
6
|
-
/**
|
7
|
-
* @internal
|
8
|
-
*/
|
9
|
-
// istanbul ignore next
|
10
|
-
export class LinkedMap {
|
11
|
-
constructor() {
|
12
|
-
this[_a] = "LinkedMap";
|
13
|
-
this._map = new Map();
|
14
|
-
this._head = undefined;
|
15
|
-
this._tail = undefined;
|
16
|
-
this._size = 0;
|
17
|
-
this._state = 0;
|
18
|
-
}
|
19
|
-
clear() {
|
20
|
-
this._map.clear();
|
21
|
-
this._head = undefined;
|
22
|
-
this._tail = undefined;
|
23
|
-
this._size = 0;
|
24
|
-
this._state++;
|
25
|
-
}
|
26
|
-
isEmpty() {
|
27
|
-
return !this._head && !this._tail;
|
28
|
-
}
|
29
|
-
get size() {
|
30
|
-
return this._size;
|
31
|
-
}
|
32
|
-
get first() {
|
33
|
-
return this._head?.value;
|
34
|
-
}
|
35
|
-
get last() {
|
36
|
-
return this._tail?.value;
|
37
|
-
}
|
38
|
-
has(key) {
|
39
|
-
return this._map.has(key);
|
40
|
-
}
|
41
|
-
get(key, touch = 0 /* None */) {
|
42
|
-
const item = this._map.get(key);
|
43
|
-
if (!item) {
|
44
|
-
return undefined;
|
45
|
-
}
|
46
|
-
if (touch !== 0 /* None */) {
|
47
|
-
this.touch(item, touch);
|
48
|
-
}
|
49
|
-
return item.value;
|
50
|
-
}
|
51
|
-
set(key, value, touch = 0 /* None */) {
|
52
|
-
let item = this._map.get(key);
|
53
|
-
if (item) {
|
54
|
-
item.value = value;
|
55
|
-
if (touch !== 0 /* None */) {
|
56
|
-
this.touch(item, touch);
|
57
|
-
}
|
58
|
-
}
|
59
|
-
else {
|
60
|
-
item = { key, value, next: undefined, previous: undefined };
|
61
|
-
switch (touch) {
|
62
|
-
case 0 /* None */:
|
63
|
-
this.addItemLast(item);
|
64
|
-
break;
|
65
|
-
case 1 /* AsOld */:
|
66
|
-
this.addItemFirst(item);
|
67
|
-
break;
|
68
|
-
case 2 /* AsNew */:
|
69
|
-
this.addItemLast(item);
|
70
|
-
break;
|
71
|
-
default:
|
72
|
-
this.addItemLast(item);
|
73
|
-
break;
|
74
|
-
}
|
75
|
-
this._map.set(key, item);
|
76
|
-
this._size++;
|
77
|
-
}
|
78
|
-
return this;
|
79
|
-
}
|
80
|
-
delete(key) {
|
81
|
-
return !!this.remove(key);
|
82
|
-
}
|
83
|
-
remove(key) {
|
84
|
-
const item = this._map.get(key);
|
85
|
-
if (!item) {
|
86
|
-
return undefined;
|
87
|
-
}
|
88
|
-
this._map.delete(key);
|
89
|
-
this.removeItem(item);
|
90
|
-
this._size--;
|
91
|
-
return item.value;
|
92
|
-
}
|
93
|
-
shift() {
|
94
|
-
if (!this._head && !this._tail) {
|
95
|
-
return undefined;
|
96
|
-
}
|
97
|
-
if (!this._head || !this._tail) {
|
98
|
-
throw new Error("Invalid list");
|
99
|
-
}
|
100
|
-
const item = this._head;
|
101
|
-
this._map.delete(item.key);
|
102
|
-
this.removeItem(item);
|
103
|
-
this._size--;
|
104
|
-
return item.value;
|
105
|
-
}
|
106
|
-
forEach(callbackfn, thisArg) {
|
107
|
-
const state = this._state;
|
108
|
-
let current = this._head;
|
109
|
-
while (current) {
|
110
|
-
if (thisArg) {
|
111
|
-
callbackfn.bind(thisArg)(current.value, current.key, this);
|
112
|
-
}
|
113
|
-
else {
|
114
|
-
callbackfn(current.value, current.key, this);
|
115
|
-
}
|
116
|
-
if (this._state !== state) {
|
117
|
-
throw new Error(`LinkedMap got modified during iteration.`);
|
118
|
-
}
|
119
|
-
current = current.next;
|
120
|
-
}
|
121
|
-
}
|
122
|
-
keys() {
|
123
|
-
const map = this;
|
124
|
-
const state = this._state;
|
125
|
-
let current = this._head;
|
126
|
-
const iterator = {
|
127
|
-
[Symbol.iterator]() {
|
128
|
-
return iterator;
|
129
|
-
},
|
130
|
-
next() {
|
131
|
-
if (map._state !== state) {
|
132
|
-
throw new Error(`LinkedMap got modified during iteration.`);
|
133
|
-
}
|
134
|
-
if (current) {
|
135
|
-
const result = { value: current.key, done: false };
|
136
|
-
current = current.next;
|
137
|
-
return result;
|
138
|
-
}
|
139
|
-
else {
|
140
|
-
return { value: undefined, done: true };
|
141
|
-
}
|
142
|
-
},
|
143
|
-
};
|
144
|
-
return iterator;
|
145
|
-
}
|
146
|
-
values() {
|
147
|
-
const map = this;
|
148
|
-
const state = this._state;
|
149
|
-
let current = this._head;
|
150
|
-
const iterator = {
|
151
|
-
[Symbol.iterator]() {
|
152
|
-
return iterator;
|
153
|
-
},
|
154
|
-
next() {
|
155
|
-
if (map._state !== state) {
|
156
|
-
throw new Error(`LinkedMap got modified during iteration.`);
|
157
|
-
}
|
158
|
-
if (current) {
|
159
|
-
const result = { value: current.value, done: false };
|
160
|
-
current = current.next;
|
161
|
-
return result;
|
162
|
-
}
|
163
|
-
else {
|
164
|
-
return { value: undefined, done: true };
|
165
|
-
}
|
166
|
-
},
|
167
|
-
};
|
168
|
-
return iterator;
|
169
|
-
}
|
170
|
-
entries() {
|
171
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
172
|
-
const map = this;
|
173
|
-
const state = this._state;
|
174
|
-
let current = this._head;
|
175
|
-
const iterator = {
|
176
|
-
[Symbol.iterator]() {
|
177
|
-
return iterator;
|
178
|
-
},
|
179
|
-
next() {
|
180
|
-
if (map._state !== state) {
|
181
|
-
throw new Error(`LinkedMap got modified during iteration.`);
|
182
|
-
}
|
183
|
-
if (current) {
|
184
|
-
const result = { value: [current.key, current.value], done: false };
|
185
|
-
current = current.next;
|
186
|
-
return result;
|
187
|
-
}
|
188
|
-
else {
|
189
|
-
return { value: undefined, done: true };
|
190
|
-
}
|
191
|
-
},
|
192
|
-
};
|
193
|
-
return iterator;
|
194
|
-
}
|
195
|
-
[(_a = Symbol.toStringTag, Symbol.iterator)]() {
|
196
|
-
return this.entries();
|
197
|
-
}
|
198
|
-
trimOld(newSize) {
|
199
|
-
if (newSize >= this.size) {
|
200
|
-
return;
|
201
|
-
}
|
202
|
-
if (newSize === 0) {
|
203
|
-
this.clear();
|
204
|
-
return;
|
205
|
-
}
|
206
|
-
let current = this._head;
|
207
|
-
let currentSize = this.size;
|
208
|
-
while (current && currentSize > newSize) {
|
209
|
-
this._map.delete(current.key);
|
210
|
-
current = current.next;
|
211
|
-
currentSize--;
|
212
|
-
}
|
213
|
-
this._head = current;
|
214
|
-
this._size = currentSize;
|
215
|
-
if (current) {
|
216
|
-
current.previous = undefined;
|
217
|
-
}
|
218
|
-
this._state++;
|
219
|
-
}
|
220
|
-
addItemFirst(item) {
|
221
|
-
// First time Insert
|
222
|
-
if (!this._head && !this._tail) {
|
223
|
-
this._tail = item;
|
224
|
-
}
|
225
|
-
else if (!this._head) {
|
226
|
-
throw new Error("Invalid list");
|
227
|
-
}
|
228
|
-
else {
|
229
|
-
item.next = this._head;
|
230
|
-
this._head.previous = item;
|
231
|
-
}
|
232
|
-
this._head = item;
|
233
|
-
this._state++;
|
234
|
-
}
|
235
|
-
addItemLast(item) {
|
236
|
-
// First time Insert
|
237
|
-
if (!this._head && !this._tail) {
|
238
|
-
this._head = item;
|
239
|
-
}
|
240
|
-
else if (!this._tail) {
|
241
|
-
throw new Error("Invalid list");
|
242
|
-
}
|
243
|
-
else {
|
244
|
-
item.previous = this._tail;
|
245
|
-
this._tail.next = item;
|
246
|
-
}
|
247
|
-
this._tail = item;
|
248
|
-
this._state++;
|
249
|
-
}
|
250
|
-
removeItem(item) {
|
251
|
-
if (item === this._head && item === this._tail) {
|
252
|
-
this._head = undefined;
|
253
|
-
this._tail = undefined;
|
254
|
-
}
|
255
|
-
else if (item === this._head) {
|
256
|
-
// This can only happend if size === 1 which is handle
|
257
|
-
// by the case above.
|
258
|
-
if (!item.next) {
|
259
|
-
throw new Error("Invalid list");
|
260
|
-
}
|
261
|
-
item.next.previous = undefined;
|
262
|
-
this._head = item.next;
|
263
|
-
}
|
264
|
-
else if (item === this._tail) {
|
265
|
-
// This can only happend if size === 1 which is handle
|
266
|
-
// by the case above.
|
267
|
-
if (!item.previous) {
|
268
|
-
throw new Error("Invalid list");
|
269
|
-
}
|
270
|
-
item.previous.next = undefined;
|
271
|
-
this._tail = item.previous;
|
272
|
-
}
|
273
|
-
else {
|
274
|
-
const next = item.next;
|
275
|
-
const previous = item.previous;
|
276
|
-
if (!next || !previous) {
|
277
|
-
throw new Error("Invalid list");
|
278
|
-
}
|
279
|
-
next.previous = previous;
|
280
|
-
previous.next = next;
|
281
|
-
}
|
282
|
-
item.next = undefined;
|
283
|
-
item.previous = undefined;
|
284
|
-
this._state++;
|
285
|
-
}
|
286
|
-
touch(item, touch) {
|
287
|
-
if (!this._head || !this._tail) {
|
288
|
-
throw new Error("Invalid list");
|
289
|
-
}
|
290
|
-
if ((touch !== 1 /* AsOld */ && touch !== 2 /* AsNew */)) {
|
291
|
-
return;
|
292
|
-
}
|
293
|
-
if (touch === 1 /* AsOld */) {
|
294
|
-
if (item === this._head) {
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
const next = item.next;
|
298
|
-
const previous = item.previous;
|
299
|
-
// Unlink the item
|
300
|
-
if (item === this._tail) {
|
301
|
-
// previous must be defined since item was not head but is tail
|
302
|
-
// So there are more than on item in the map
|
303
|
-
previous.next = undefined;
|
304
|
-
this._tail = previous;
|
305
|
-
}
|
306
|
-
else {
|
307
|
-
// Both next and previous are not undefined since item was neither head nor tail.
|
308
|
-
next.previous = previous;
|
309
|
-
previous.next = next;
|
310
|
-
}
|
311
|
-
// Insert the node at head
|
312
|
-
item.previous = undefined;
|
313
|
-
item.next = this._head;
|
314
|
-
this._head.previous = item;
|
315
|
-
this._head = item;
|
316
|
-
this._state++;
|
317
|
-
}
|
318
|
-
else if (touch === 2 /* AsNew */) {
|
319
|
-
if (item === this._tail) {
|
320
|
-
return;
|
321
|
-
}
|
322
|
-
const next = item.next;
|
323
|
-
const previous = item.previous;
|
324
|
-
// Unlink the item.
|
325
|
-
if (item === this._head) {
|
326
|
-
// next must be defined since item was not tail but is head
|
327
|
-
// So there are more than on item in the map
|
328
|
-
next.previous = undefined;
|
329
|
-
this._head = next;
|
330
|
-
}
|
331
|
-
else {
|
332
|
-
// Both next and previous are not undefined since item was neither head nor tail.
|
333
|
-
next.previous = previous;
|
334
|
-
previous.next = next;
|
335
|
-
}
|
336
|
-
item.next = undefined;
|
337
|
-
item.previous = this._tail;
|
338
|
-
this._tail.next = item;
|
339
|
-
this._tail = item;
|
340
|
-
this._state++;
|
341
|
-
}
|
342
|
-
}
|
343
|
-
toJSON() {
|
344
|
-
const data = [];
|
345
|
-
this.forEach((value, key) => {
|
346
|
-
data.push([key, value]);
|
347
|
-
});
|
348
|
-
return data;
|
349
|
-
}
|
350
|
-
fromJSON(data) {
|
351
|
-
this.clear();
|
352
|
-
for (const [key, value] of data) {
|
353
|
-
this.set(key, value);
|
354
|
-
}
|
355
|
-
}
|
356
|
-
}
|
357
|
-
/**
|
358
|
-
* @internal
|
359
|
-
*/
|
360
|
-
// istanbul ignore next
|
361
|
-
export class LRUCache extends LinkedMap {
|
362
|
-
constructor(limit, ratio = 1) {
|
363
|
-
super();
|
364
|
-
this._limit = limit;
|
365
|
-
this._ratio = Math.min(Math.max(0, ratio), 1);
|
366
|
-
}
|
367
|
-
get limit() {
|
368
|
-
return this._limit;
|
369
|
-
}
|
370
|
-
set limit(limit) {
|
371
|
-
this._limit = limit;
|
372
|
-
this.checkTrim();
|
373
|
-
}
|
374
|
-
get ratio() {
|
375
|
-
return this._ratio;
|
376
|
-
}
|
377
|
-
set ratio(ratio) {
|
378
|
-
this._ratio = Math.min(Math.max(0, ratio), 1);
|
379
|
-
this.checkTrim();
|
380
|
-
}
|
381
|
-
get(key, touch = 2 /* AsNew */) {
|
382
|
-
return super.get(key, touch);
|
383
|
-
}
|
384
|
-
peek(key) {
|
385
|
-
return super.get(key, 0 /* None */);
|
386
|
-
}
|
387
|
-
set(key, value) {
|
388
|
-
super.set(key, value, 2 /* AsNew */);
|
389
|
-
this.checkTrim();
|
390
|
-
return this;
|
391
|
-
}
|
392
|
-
checkTrim() {
|
393
|
-
if (this.size > this._limit) {
|
394
|
-
this.trimOld(Math.round(this._limit * this._ratio));
|
395
|
-
}
|
396
|
-
}
|
397
|
-
}
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
5
|
+
var _a;
|
6
|
+
/**
|
7
|
+
* @internal
|
8
|
+
*/
|
9
|
+
// istanbul ignore next
|
10
|
+
export class LinkedMap {
|
11
|
+
constructor() {
|
12
|
+
this[_a] = "LinkedMap";
|
13
|
+
this._map = new Map();
|
14
|
+
this._head = undefined;
|
15
|
+
this._tail = undefined;
|
16
|
+
this._size = 0;
|
17
|
+
this._state = 0;
|
18
|
+
}
|
19
|
+
clear() {
|
20
|
+
this._map.clear();
|
21
|
+
this._head = undefined;
|
22
|
+
this._tail = undefined;
|
23
|
+
this._size = 0;
|
24
|
+
this._state++;
|
25
|
+
}
|
26
|
+
isEmpty() {
|
27
|
+
return !this._head && !this._tail;
|
28
|
+
}
|
29
|
+
get size() {
|
30
|
+
return this._size;
|
31
|
+
}
|
32
|
+
get first() {
|
33
|
+
return this._head?.value;
|
34
|
+
}
|
35
|
+
get last() {
|
36
|
+
return this._tail?.value;
|
37
|
+
}
|
38
|
+
has(key) {
|
39
|
+
return this._map.has(key);
|
40
|
+
}
|
41
|
+
get(key, touch = 0 /* None */) {
|
42
|
+
const item = this._map.get(key);
|
43
|
+
if (!item) {
|
44
|
+
return undefined;
|
45
|
+
}
|
46
|
+
if (touch !== 0 /* None */) {
|
47
|
+
this.touch(item, touch);
|
48
|
+
}
|
49
|
+
return item.value;
|
50
|
+
}
|
51
|
+
set(key, value, touch = 0 /* None */) {
|
52
|
+
let item = this._map.get(key);
|
53
|
+
if (item) {
|
54
|
+
item.value = value;
|
55
|
+
if (touch !== 0 /* None */) {
|
56
|
+
this.touch(item, touch);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
item = { key, value, next: undefined, previous: undefined };
|
61
|
+
switch (touch) {
|
62
|
+
case 0 /* None */:
|
63
|
+
this.addItemLast(item);
|
64
|
+
break;
|
65
|
+
case 1 /* AsOld */:
|
66
|
+
this.addItemFirst(item);
|
67
|
+
break;
|
68
|
+
case 2 /* AsNew */:
|
69
|
+
this.addItemLast(item);
|
70
|
+
break;
|
71
|
+
default:
|
72
|
+
this.addItemLast(item);
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
this._map.set(key, item);
|
76
|
+
this._size++;
|
77
|
+
}
|
78
|
+
return this;
|
79
|
+
}
|
80
|
+
delete(key) {
|
81
|
+
return !!this.remove(key);
|
82
|
+
}
|
83
|
+
remove(key) {
|
84
|
+
const item = this._map.get(key);
|
85
|
+
if (!item) {
|
86
|
+
return undefined;
|
87
|
+
}
|
88
|
+
this._map.delete(key);
|
89
|
+
this.removeItem(item);
|
90
|
+
this._size--;
|
91
|
+
return item.value;
|
92
|
+
}
|
93
|
+
shift() {
|
94
|
+
if (!this._head && !this._tail) {
|
95
|
+
return undefined;
|
96
|
+
}
|
97
|
+
if (!this._head || !this._tail) {
|
98
|
+
throw new Error("Invalid list");
|
99
|
+
}
|
100
|
+
const item = this._head;
|
101
|
+
this._map.delete(item.key);
|
102
|
+
this.removeItem(item);
|
103
|
+
this._size--;
|
104
|
+
return item.value;
|
105
|
+
}
|
106
|
+
forEach(callbackfn, thisArg) {
|
107
|
+
const state = this._state;
|
108
|
+
let current = this._head;
|
109
|
+
while (current) {
|
110
|
+
if (thisArg) {
|
111
|
+
callbackfn.bind(thisArg)(current.value, current.key, this);
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
callbackfn(current.value, current.key, this);
|
115
|
+
}
|
116
|
+
if (this._state !== state) {
|
117
|
+
throw new Error(`LinkedMap got modified during iteration.`);
|
118
|
+
}
|
119
|
+
current = current.next;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
keys() {
|
123
|
+
const map = this;
|
124
|
+
const state = this._state;
|
125
|
+
let current = this._head;
|
126
|
+
const iterator = {
|
127
|
+
[Symbol.iterator]() {
|
128
|
+
return iterator;
|
129
|
+
},
|
130
|
+
next() {
|
131
|
+
if (map._state !== state) {
|
132
|
+
throw new Error(`LinkedMap got modified during iteration.`);
|
133
|
+
}
|
134
|
+
if (current) {
|
135
|
+
const result = { value: current.key, done: false };
|
136
|
+
current = current.next;
|
137
|
+
return result;
|
138
|
+
}
|
139
|
+
else {
|
140
|
+
return { value: undefined, done: true };
|
141
|
+
}
|
142
|
+
},
|
143
|
+
};
|
144
|
+
return iterator;
|
145
|
+
}
|
146
|
+
values() {
|
147
|
+
const map = this;
|
148
|
+
const state = this._state;
|
149
|
+
let current = this._head;
|
150
|
+
const iterator = {
|
151
|
+
[Symbol.iterator]() {
|
152
|
+
return iterator;
|
153
|
+
},
|
154
|
+
next() {
|
155
|
+
if (map._state !== state) {
|
156
|
+
throw new Error(`LinkedMap got modified during iteration.`);
|
157
|
+
}
|
158
|
+
if (current) {
|
159
|
+
const result = { value: current.value, done: false };
|
160
|
+
current = current.next;
|
161
|
+
return result;
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
return { value: undefined, done: true };
|
165
|
+
}
|
166
|
+
},
|
167
|
+
};
|
168
|
+
return iterator;
|
169
|
+
}
|
170
|
+
entries() {
|
171
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
172
|
+
const map = this;
|
173
|
+
const state = this._state;
|
174
|
+
let current = this._head;
|
175
|
+
const iterator = {
|
176
|
+
[Symbol.iterator]() {
|
177
|
+
return iterator;
|
178
|
+
},
|
179
|
+
next() {
|
180
|
+
if (map._state !== state) {
|
181
|
+
throw new Error(`LinkedMap got modified during iteration.`);
|
182
|
+
}
|
183
|
+
if (current) {
|
184
|
+
const result = { value: [current.key, current.value], done: false };
|
185
|
+
current = current.next;
|
186
|
+
return result;
|
187
|
+
}
|
188
|
+
else {
|
189
|
+
return { value: undefined, done: true };
|
190
|
+
}
|
191
|
+
},
|
192
|
+
};
|
193
|
+
return iterator;
|
194
|
+
}
|
195
|
+
[(_a = Symbol.toStringTag, Symbol.iterator)]() {
|
196
|
+
return this.entries();
|
197
|
+
}
|
198
|
+
trimOld(newSize) {
|
199
|
+
if (newSize >= this.size) {
|
200
|
+
return;
|
201
|
+
}
|
202
|
+
if (newSize === 0) {
|
203
|
+
this.clear();
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
let current = this._head;
|
207
|
+
let currentSize = this.size;
|
208
|
+
while (current && currentSize > newSize) {
|
209
|
+
this._map.delete(current.key);
|
210
|
+
current = current.next;
|
211
|
+
currentSize--;
|
212
|
+
}
|
213
|
+
this._head = current;
|
214
|
+
this._size = currentSize;
|
215
|
+
if (current) {
|
216
|
+
current.previous = undefined;
|
217
|
+
}
|
218
|
+
this._state++;
|
219
|
+
}
|
220
|
+
addItemFirst(item) {
|
221
|
+
// First time Insert
|
222
|
+
if (!this._head && !this._tail) {
|
223
|
+
this._tail = item;
|
224
|
+
}
|
225
|
+
else if (!this._head) {
|
226
|
+
throw new Error("Invalid list");
|
227
|
+
}
|
228
|
+
else {
|
229
|
+
item.next = this._head;
|
230
|
+
this._head.previous = item;
|
231
|
+
}
|
232
|
+
this._head = item;
|
233
|
+
this._state++;
|
234
|
+
}
|
235
|
+
addItemLast(item) {
|
236
|
+
// First time Insert
|
237
|
+
if (!this._head && !this._tail) {
|
238
|
+
this._head = item;
|
239
|
+
}
|
240
|
+
else if (!this._tail) {
|
241
|
+
throw new Error("Invalid list");
|
242
|
+
}
|
243
|
+
else {
|
244
|
+
item.previous = this._tail;
|
245
|
+
this._tail.next = item;
|
246
|
+
}
|
247
|
+
this._tail = item;
|
248
|
+
this._state++;
|
249
|
+
}
|
250
|
+
removeItem(item) {
|
251
|
+
if (item === this._head && item === this._tail) {
|
252
|
+
this._head = undefined;
|
253
|
+
this._tail = undefined;
|
254
|
+
}
|
255
|
+
else if (item === this._head) {
|
256
|
+
// This can only happend if size === 1 which is handle
|
257
|
+
// by the case above.
|
258
|
+
if (!item.next) {
|
259
|
+
throw new Error("Invalid list");
|
260
|
+
}
|
261
|
+
item.next.previous = undefined;
|
262
|
+
this._head = item.next;
|
263
|
+
}
|
264
|
+
else if (item === this._tail) {
|
265
|
+
// This can only happend if size === 1 which is handle
|
266
|
+
// by the case above.
|
267
|
+
if (!item.previous) {
|
268
|
+
throw new Error("Invalid list");
|
269
|
+
}
|
270
|
+
item.previous.next = undefined;
|
271
|
+
this._tail = item.previous;
|
272
|
+
}
|
273
|
+
else {
|
274
|
+
const next = item.next;
|
275
|
+
const previous = item.previous;
|
276
|
+
if (!next || !previous) {
|
277
|
+
throw new Error("Invalid list");
|
278
|
+
}
|
279
|
+
next.previous = previous;
|
280
|
+
previous.next = next;
|
281
|
+
}
|
282
|
+
item.next = undefined;
|
283
|
+
item.previous = undefined;
|
284
|
+
this._state++;
|
285
|
+
}
|
286
|
+
touch(item, touch) {
|
287
|
+
if (!this._head || !this._tail) {
|
288
|
+
throw new Error("Invalid list");
|
289
|
+
}
|
290
|
+
if ((touch !== 1 /* AsOld */ && touch !== 2 /* AsNew */)) {
|
291
|
+
return;
|
292
|
+
}
|
293
|
+
if (touch === 1 /* AsOld */) {
|
294
|
+
if (item === this._head) {
|
295
|
+
return;
|
296
|
+
}
|
297
|
+
const next = item.next;
|
298
|
+
const previous = item.previous;
|
299
|
+
// Unlink the item
|
300
|
+
if (item === this._tail) {
|
301
|
+
// previous must be defined since item was not head but is tail
|
302
|
+
// So there are more than on item in the map
|
303
|
+
previous.next = undefined;
|
304
|
+
this._tail = previous;
|
305
|
+
}
|
306
|
+
else {
|
307
|
+
// Both next and previous are not undefined since item was neither head nor tail.
|
308
|
+
next.previous = previous;
|
309
|
+
previous.next = next;
|
310
|
+
}
|
311
|
+
// Insert the node at head
|
312
|
+
item.previous = undefined;
|
313
|
+
item.next = this._head;
|
314
|
+
this._head.previous = item;
|
315
|
+
this._head = item;
|
316
|
+
this._state++;
|
317
|
+
}
|
318
|
+
else if (touch === 2 /* AsNew */) {
|
319
|
+
if (item === this._tail) {
|
320
|
+
return;
|
321
|
+
}
|
322
|
+
const next = item.next;
|
323
|
+
const previous = item.previous;
|
324
|
+
// Unlink the item.
|
325
|
+
if (item === this._head) {
|
326
|
+
// next must be defined since item was not tail but is head
|
327
|
+
// So there are more than on item in the map
|
328
|
+
next.previous = undefined;
|
329
|
+
this._head = next;
|
330
|
+
}
|
331
|
+
else {
|
332
|
+
// Both next and previous are not undefined since item was neither head nor tail.
|
333
|
+
next.previous = previous;
|
334
|
+
previous.next = next;
|
335
|
+
}
|
336
|
+
item.next = undefined;
|
337
|
+
item.previous = this._tail;
|
338
|
+
this._tail.next = item;
|
339
|
+
this._tail = item;
|
340
|
+
this._state++;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
toJSON() {
|
344
|
+
const data = [];
|
345
|
+
this.forEach((value, key) => {
|
346
|
+
data.push([key, value]);
|
347
|
+
});
|
348
|
+
return data;
|
349
|
+
}
|
350
|
+
fromJSON(data) {
|
351
|
+
this.clear();
|
352
|
+
for (const [key, value] of data) {
|
353
|
+
this.set(key, value);
|
354
|
+
}
|
355
|
+
}
|
356
|
+
}
|
357
|
+
/**
|
358
|
+
* @internal
|
359
|
+
*/
|
360
|
+
// istanbul ignore next
|
361
|
+
export class LRUCache extends LinkedMap {
|
362
|
+
constructor(limit, ratio = 1) {
|
363
|
+
super();
|
364
|
+
this._limit = limit;
|
365
|
+
this._ratio = Math.min(Math.max(0, ratio), 1);
|
366
|
+
}
|
367
|
+
get limit() {
|
368
|
+
return this._limit;
|
369
|
+
}
|
370
|
+
set limit(limit) {
|
371
|
+
this._limit = limit;
|
372
|
+
this.checkTrim();
|
373
|
+
}
|
374
|
+
get ratio() {
|
375
|
+
return this._ratio;
|
376
|
+
}
|
377
|
+
set ratio(ratio) {
|
378
|
+
this._ratio = Math.min(Math.max(0, ratio), 1);
|
379
|
+
this.checkTrim();
|
380
|
+
}
|
381
|
+
get(key, touch = 2 /* AsNew */) {
|
382
|
+
return super.get(key, touch);
|
383
|
+
}
|
384
|
+
peek(key) {
|
385
|
+
return super.get(key, 0 /* None */);
|
386
|
+
}
|
387
|
+
set(key, value) {
|
388
|
+
super.set(key, value, 2 /* AsNew */);
|
389
|
+
this.checkTrim();
|
390
|
+
return this;
|
391
|
+
}
|
392
|
+
checkTrim() {
|
393
|
+
if (this.size > this._limit) {
|
394
|
+
this.trimOld(Math.round(this._limit * this._ratio));
|
395
|
+
}
|
396
|
+
}
|
397
|
+
}
|
398
398
|
//# sourceMappingURL=map.js.map
|