@itwin/core-backend 5.7.2 → 5.8.0-dev.10

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/ECDb.d.ts +26 -0
  3. package/lib/cjs/ECDb.d.ts.map +1 -1
  4. package/lib/cjs/ECDb.js +53 -2
  5. package/lib/cjs/ECDb.js.map +1 -1
  6. package/lib/cjs/ECSqlRowExecutor.d.ts +66 -0
  7. package/lib/cjs/ECSqlRowExecutor.d.ts.map +1 -0
  8. package/lib/cjs/ECSqlRowExecutor.js +135 -0
  9. package/lib/cjs/ECSqlRowExecutor.js.map +1 -0
  10. package/lib/cjs/ECSqlStatement.d.ts +13 -1
  11. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  12. package/lib/cjs/ECSqlStatement.js +30 -0
  13. package/lib/cjs/ECSqlStatement.js.map +1 -1
  14. package/lib/cjs/ECSqlSyncReader.d.ts +104 -0
  15. package/lib/cjs/ECSqlSyncReader.d.ts.map +1 -0
  16. package/lib/cjs/ECSqlSyncReader.js +191 -0
  17. package/lib/cjs/ECSqlSyncReader.js.map +1 -0
  18. package/lib/cjs/IModelDb.d.ts +26 -1
  19. package/lib/cjs/IModelDb.d.ts.map +1 -1
  20. package/lib/cjs/IModelDb.js +55 -0
  21. package/lib/cjs/IModelDb.js.map +1 -1
  22. package/lib/cjs/IpcHost.d.ts.map +1 -1
  23. package/lib/cjs/IpcHost.js.map +1 -1
  24. package/lib/cjs/LineStyle.d.ts +6 -0
  25. package/lib/cjs/LineStyle.d.ts.map +1 -1
  26. package/lib/cjs/LineStyle.js +41 -32
  27. package/lib/cjs/LineStyle.js.map +1 -1
  28. package/lib/cjs/core-backend.d.ts +1 -0
  29. package/lib/cjs/core-backend.d.ts.map +1 -1
  30. package/lib/cjs/core-backend.js +1 -0
  31. package/lib/cjs/core-backend.js.map +1 -1
  32. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  33. package/lib/cjs/internal/workspace/WorkspaceImpl.js +10 -2
  34. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  35. package/lib/esm/ECDb.d.ts +26 -0
  36. package/lib/esm/ECDb.d.ts.map +1 -1
  37. package/lib/esm/ECDb.js +54 -3
  38. package/lib/esm/ECDb.js.map +1 -1
  39. package/lib/esm/ECSqlRowExecutor.d.ts +66 -0
  40. package/lib/esm/ECSqlRowExecutor.d.ts.map +1 -0
  41. package/lib/esm/ECSqlRowExecutor.js +131 -0
  42. package/lib/esm/ECSqlRowExecutor.js.map +1 -0
  43. package/lib/esm/ECSqlStatement.d.ts +13 -1
  44. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  45. package/lib/esm/ECSqlStatement.js +30 -0
  46. package/lib/esm/ECSqlStatement.js.map +1 -1
  47. package/lib/esm/ECSqlSyncReader.d.ts +104 -0
  48. package/lib/esm/ECSqlSyncReader.d.ts.map +1 -0
  49. package/lib/esm/ECSqlSyncReader.js +187 -0
  50. package/lib/esm/ECSqlSyncReader.js.map +1 -0
  51. package/lib/esm/IModelDb.d.ts +26 -1
  52. package/lib/esm/IModelDb.d.ts.map +1 -1
  53. package/lib/esm/IModelDb.js +55 -0
  54. package/lib/esm/IModelDb.js.map +1 -1
  55. package/lib/esm/IpcHost.d.ts.map +1 -1
  56. package/lib/esm/IpcHost.js.map +1 -1
  57. package/lib/esm/LineStyle.d.ts +6 -0
  58. package/lib/esm/LineStyle.d.ts.map +1 -1
  59. package/lib/esm/LineStyle.js +41 -32
  60. package/lib/esm/LineStyle.js.map +1 -1
  61. package/lib/esm/core-backend.d.ts +1 -0
  62. package/lib/esm/core-backend.d.ts.map +1 -1
  63. package/lib/esm/core-backend.js +1 -0
  64. package/lib/esm/core-backend.js.map +1 -1
  65. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  66. package/lib/esm/internal/workspace/WorkspaceImpl.js +10 -2
  67. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  68. package/lib/esm/test/ecdb/ECSqlQuery.test.js +113 -14
  69. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  70. package/lib/esm/test/ecdb/ECSqlSyncReader.test.d.ts +2 -0
  71. package/lib/esm/test/ecdb/ECSqlSyncReader.test.d.ts.map +1 -0
  72. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js +122 -0
  73. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -0
  74. package/lib/esm/test/ecdb/QueryReaders.test.d.ts +2 -0
  75. package/lib/esm/test/ecdb/QueryReaders.test.d.ts.map +1 -0
  76. package/lib/esm/test/ecdb/QueryReaders.test.js +1427 -0
  77. package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -0
  78. package/lib/esm/test/ecsql/src/ECSqlTestParser.d.ts +1 -1
  79. package/lib/esm/test/ecsql/src/ECSqlTestParser.d.ts.map +1 -1
  80. package/lib/esm/test/ecsql/src/ECSqlTestParser.js +11 -5
  81. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  82. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +178 -100
  83. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  84. package/lib/esm/test/standalone/StandaloneDb.test.js +51 -1
  85. package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
  86. package/lib/esm/test/standalone/Workspace.test.js +53 -0
  87. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  88. package/lib/esm/test/standalone/iModelDb.test.d.ts +2 -0
  89. package/lib/esm/test/standalone/iModelDb.test.d.ts.map +1 -0
  90. package/lib/esm/test/standalone/iModelDb.test.js +35 -0
  91. package/lib/esm/test/standalone/iModelDb.test.js.map +1 -0
  92. package/package.json +14 -14
  93. package/lib/esm/test/ecdb/ECSqlReader.test.d.ts +0 -2
  94. package/lib/esm/test/ecdb/ECSqlReader.test.d.ts.map +0 -1
  95. package/lib/esm/test/ecdb/ECSqlReader.test.js +0 -669
  96. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IpcHost.d.ts","sourceRoot":"","sources":["../../src/IpcHost.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EACgC,yBAAyB,EAC7B,mBAAmB,EAAmB,WAAW,EAAE,gBAAgB,EACxC,cAAc,EAAkE,gBAAgB,EAC7J,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAwB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAc,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAK7D;;;IAGI;AACJ,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE;QACR,wGAAwG;QACxG,MAAM,CAAC,EAAE,gBAAgB,CAAC;QAE1B,iDAAiD;QACjD,UAAU,CAAC,EAAE;YACX,OAAO,CAAC,EAAE,OAAO,CAAC;SACnB,CAAC;KACH,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,OAAO;IAClB,OAAc,OAAO,UAAS;IAC9B,OAAO,CAAC,MAAM,CAAC,IAAI,CAA+B;IAClD,2EAA2E;IAC3E,OAAO,CAAC,MAAM,KAAK,GAAG,GAA2C;IACjE,gIAAgI;IAChI,WAAkB,OAAO,IAAI,OAAO,CAAoC;IAExE;;;;OAIG;WACW,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAIzD;;;;;OAKG;WACW,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc;IAGhG;;;;;OAKG;WACW,WAAW,C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AAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;IACzD,CAAC;IACM,KAAK,CAAC,YAAY,CAAC,GAAW;QACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,CAAC;IAC3D,CAAC;IACM,KAAK,CAAC,iBAAiB,CAAC,GAAW;QACxC,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAChE,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,IAAkB;QAC9C,OAAO,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAsB,EAAE,UAAgC,EAAE,gBAAyB;IAC1H,MAAM,QAAQ,GAAG,gBAAgB,IAAI,GAAG,CAAC,CAAC,+DAA+D;IACzG,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC;IACrC,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;YACvC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { assert, BentleyError, IModelStatus, JsonUtils, Logger, LogLevel, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndex, ChangesetIndexAndId, EditingScopeNotifications, getPullChangesIpcChannel, IModelConnectionProps, IModelError, IModelNotFoundResponse, IModelRpcProps,\r\n ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketBackend, iTwinChannel,\r\n OpenBriefcaseProps, OpenCheckpointArgs, PullChangesOptions, RemoveFunction, SnapshotOpenOptions, StandaloneOpenOptions, TileTreeContentIds, TxnNotifications,\r\n} from \"@itwin/core-common\";\r\nimport { ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\r\nimport { BriefcaseDb, IModelDb, SnapshotDb, StandaloneDb } from \"./IModelDb\";\r\nimport { IModelHost, IModelHostOptions } from \"./IModelHost\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\nimport { cancelTileContentRequests } from \"./rpc-impl/IModelTileRpcImpl\";\r\n\r\n/**\r\n * Options for [[IpcHost.startup]]\r\n * @public\r\n */\r\nexport interface IpcHostOpts {\r\n iModelHost?: IModelHostOptions;\r\n ipcHost?: {\r\n /** The Ipc socket to use for communications with frontend. Allows undefined only for headless tests. */\r\n socket?: IpcSocketBackend;\r\n\r\n /** don't send stack information on exceptions */\r\n exceptions?: {\r\n noStack?: boolean;\r\n };\r\n };\r\n}\r\n\r\n/**\r\n * Used by applications that have a dedicated backend. IpcHosts may send messages to their corresponding IpcApp.\r\n * @note if either end terminates, the other must too.\r\n * @public\r\n */\r\nexport class IpcHost {\r\n public static noStack = false;\r\n private static _ipc: IpcSocketBackend | undefined;\r\n /** Get the implementation of the [IpcSocketBackend]($common) interface. */\r\n private static get ipc(): IpcSocketBackend { return this._ipc!; } // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n /** Determine whether Ipc is available for this backend. This will only be true if [[startup]] has been called on this class. */\r\n public static get isValid(): boolean { return undefined !== this._ipc; }\r\n\r\n /**\r\n * Send a message to the frontend over an Ipc channel.\r\n * @param channel the name of the channel matching the name registered with [[IpcApp.addListener]].\r\n * @param data The content of the message.\r\n */\r\n public static send(channel: string, ...data: any[]): void {\r\n this.ipc.send(iTwinChannel(channel), ...data);\r\n }\r\n\r\n /**\r\n * Establish a handler for an Ipc channel to receive [[Frontend.invoke]] calls\r\n * @param channel The name of the channel for this handler.\r\n * @param handler A function that supplies the implementation for `channel`\r\n * @note returns A function to call to remove the handler.\r\n */\r\n public static handle(channel: string, handler: (...args: any[]) => Promise<any>): RemoveFunction {\r\n return this.ipc.handle(iTwinChannel(channel), handler);\r\n }\r\n /**\r\n * Establish a handler to receive messages sent via [[IpcApp.send]].\r\n * @param channel The name of the channel for the messages.\r\n * @param listener A function called when messages are sent over `channel`\r\n * @note returns A function to call to remove the listener.\r\n */\r\n public static addListener(channel: string, listener: IpcListener): RemoveFunction {\r\n return this.ipc.addListener(iTwinChannel(channel), listener);\r\n }\r\n /**\r\n * Remove a previously registered listener\r\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\r\n * @param listener The function passed to [[addListener]]\r\n */\r\n public static removeListener(channel: string, listener: IpcListener): void {\r\n this.ipc.removeListener(iTwinChannel(channel), listener);\r\n }\r\n\r\n private static notify(channel: string, briefcase: BriefcaseDb | StandaloneDb, methodName: string, ...args: any[]) {\r\n if (this.isValid)\r\n return this.send(`${channel}/${briefcase.key}`, methodName, ...args);\r\n }\r\n\r\n /** @internal */\r\n public static notifyIpcFrontend<T extends keyof IpcAppNotifications>(methodName: T, ...args: Parameters<IpcAppNotifications[T]>) {\r\n return IpcHost.send(ipcAppChannels.appNotify, methodName, ...args);\r\n }\r\n\r\n /** @internal */\r\n public static notifyTxns<T extends keyof TxnNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<TxnNotifications[T]>) {\r\n this.notify(ipcAppChannels.txns, briefcase, methodName, ...args);\r\n }\r\n\r\n /** @internal */\r\n public static notifyEditingScope<T extends keyof EditingScopeNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<EditingScopeNotifications[T]>) {\r\n this.notify(ipcAppChannels.editingScope, briefcase, methodName, ...args);\r\n }\r\n\r\n /**\r\n * Start the backend of an Ipc app.\r\n * @param opt\r\n * @note this method calls [[IModelHost.startup]] internally.\r\n */\r\n public static async startup(opt?: IpcHostOpts): Promise<void> {\r\n this._ipc = opt?.ipcHost?.socket;\r\n if (opt?.ipcHost?.exceptions?.noStack)\r\n this.noStack = true;\r\n\r\n if (this.isValid) { // for tests, we use IpcHost but don't have a frontend\r\n IpcAppHandler.register();\r\n }\r\n\r\n await IModelHost.startup(opt?.iModelHost);\r\n }\r\n\r\n /** Shutdown IpcHost backend. Also calls [[IModelHost.shutdown]] */\r\n public static async shutdown(): Promise<void> {\r\n this._ipc = undefined;\r\n await IModelHost.shutdown();\r\n }\r\n}\r\n\r\n/**\r\n * Base class for all implementations of an Ipc interface.\r\n *\r\n * Create a subclass to implement your Ipc interface. Your class should be declared like this:\r\n * ```ts\r\n * class MyHandler extends IpcHandler implements MyInterface\r\n * ```\r\n * to ensure all methods and signatures are correct.\r\n *\r\n * Then, call `MyClass.register` at startup to connect your class to your channel.\r\n * @public\r\n */\r\nexport abstract class IpcHandler {\r\n /**\r\n * All subclasses *must* implement this method to specify their channel name.\r\n *\r\n * Channel names are the key that connects Handlers and senders. The channel name of IpcHandlers must exactly match the name used by senders.\r\n * By convention, channel names should be prefixed by a *namespace* (e.g. `${appName}/`)\r\n * unique enough to disambiguate them from channels for other apps that may be running in the same processes.\r\n */\r\n public abstract get channelName(): string;\r\n\r\n /**\r\n * Register this class as the handler for methods on its channel. This static method creates a new instance\r\n * that becomes the handler and is `this` when its methods are called.\r\n * @returns A function that can be called to remove the handler.\r\n * @note this method should only be called once per channel. If it is called multiple times, subsequent calls replace the previous ones.\r\n */\r\n public static register(): RemoveFunction {\r\n const impl = new (this as any)() as IpcHandler; // create an instance of subclass. \"as any\" is necessary because base class is abstract\r\n const prohibitedFunctions = Object.getOwnPropertyNames(Object.getPrototypeOf({}));\r\n\r\n return IpcHost.handle(impl.channelName, async (_evt: Event, funcName: string, ...args: any[]): Promise<IpcInvokeReturn> => {\r\n try {\r\n if (prohibitedFunctions.includes(funcName))\r\n throw new Error(`Method \"${funcName}\" not available for channel: ${impl.channelName}`);\r\n\r\n const func = (impl as any)[funcName];\r\n if (typeof func !== \"function\")\r\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${impl.constructor.name}.${funcName}\" not found on IpcHandler registered for channel: ${impl.channelName}`);\r\n\r\n return { result: await func.call(impl, ...args) };\r\n } catch (err: unknown) {\r\n\r\n if (!JsonUtils.isObject(err)) // if the exception isn't an object, just forward it\r\n return { error: err as any };\r\n\r\n const ret = { error: { ...err } };\r\n ret.error.message = err.message; // NB: .message, and .stack members of Error are not enumerable, so spread operator above does not copy them.\r\n if (!IpcHost.noStack)\r\n ret.error.stack = err.stack;\r\n\r\n if (err instanceof BentleyError) {\r\n ret.error.iTwinErrorId = err.iTwinErrorId;\r\n if (err.hasMetaData)\r\n ret.error.loggingMetadata = err.loggingMetadata;\r\n delete ret.error._metaData;\r\n }\r\n return ret;\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Implementation of IpcAppFunctions\r\n */\r\nclass IpcAppHandler extends IpcHandler implements IpcAppFunctions {\r\n public get channelName() { return ipcAppChannels.functions; }\r\n\r\n private _iModelKeyToPullStatus = new Map<string, ProgressStatus>();\r\n\r\n public async log(_timestamp: number, level: LogLevel, category: string, message: string, metaData?: any): Promise<void> {\r\n switch (level) {\r\n case LogLevel.Error:\r\n Logger.logError(category, message, metaData);\r\n break;\r\n case LogLevel.Info:\r\n Logger.logInfo(category, message, metaData);\r\n break;\r\n case LogLevel.Trace:\r\n Logger.logTrace(category, message, metaData);\r\n break;\r\n case LogLevel.Warning:\r\n Logger.logWarning(category, message, metaData);\r\n break;\r\n }\r\n }\r\n\r\n public async cancelTileContentRequests(tokenProps: IModelRpcProps, contentIds: TileTreeContentIds[]): Promise<void> {\r\n return cancelTileContentRequests(tokenProps, contentIds);\r\n }\r\n public async cancelElementGraphicsRequests(key: string, requestIds: string[]): Promise<void> {\r\n return IModelDb.findByKey(key)[_nativeDb].cancelElementGraphicsRequests(requestIds);\r\n }\r\n public async openBriefcase(args: OpenBriefcaseProps): Promise<IModelConnectionProps> {\r\n const db = await BriefcaseDb.open(args);\r\n return db.toJSON();\r\n }\r\n public async openCheckpoint(checkpoint: OpenCheckpointArgs): Promise<IModelConnectionProps> {\r\n return (await SnapshotDb.openCheckpoint(checkpoint)).getConnectionProps();\r\n }\r\n public async openStandalone(filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions): Promise<IModelConnectionProps> {\r\n return StandaloneDb.openFile(filePath, openMode, opts).getConnectionProps();\r\n }\r\n public async openSnapshot(filePath: string, opts?: SnapshotOpenOptions): Promise<IModelConnectionProps> {\r\n let resolvedFileName: string | undefined = filePath;\r\n if (IModelHost.snapshotFileNameResolver) { // eslint-disable-line @typescript-eslint/no-deprecated\r\n resolvedFileName = IModelHost.snapshotFileNameResolver.tryResolveFileName(filePath); // eslint-disable-line @typescript-eslint/no-deprecated\r\n if (!resolvedFileName)\r\n throw new IModelNotFoundResponse(); // eslint-disable-line @typescript-eslint/only-throw-error\r\n }\r\n return SnapshotDb.openFile(resolvedFileName, opts).getConnectionProps();\r\n }\r\n public async closeIModel(key: string): Promise<void> {\r\n IModelDb.findByKey(key).close();\r\n }\r\n public async saveChanges(key: string, description?: string): Promise<void> {\r\n IModelDb.findByKey(key).saveChanges(description);\r\n }\r\n public async abandonChanges(key: string): Promise<void> {\r\n IModelDb.findByKey(key).abandonChanges();\r\n }\r\n public async hasPendingTxns(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].hasPendingTxns();\r\n }\r\n\r\n public async isUndoPossible(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].isUndoPossible();\r\n }\r\n public async isRedoPossible(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].isRedoPossible();\r\n }\r\n public async getUndoString(key: string): Promise<string> {\r\n return IModelDb.findByKey(key)[_nativeDb].getUndoString();\r\n }\r\n public async getRedoString(key: string): Promise<string> {\r\n return IModelDb.findByKey(key)[_nativeDb].getRedoString();\r\n }\r\n\r\n public async pullChanges(key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<ChangesetIndexAndId> {\r\n const iModelDb = BriefcaseDb.findByKey(key);\r\n\r\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Continue);\r\n const checkAbort = () => this._iModelKeyToPullStatus.get(key) ?? ProgressStatus.Continue;\r\n\r\n let onProgress: ProgressFunction | undefined;\r\n if (options?.reportProgress) {\r\n const progressCallback: ProgressFunction = (loaded, total) => {\r\n IpcHost.send(getPullChangesIpcChannel(iModelDb.iModelId), { loaded, total });\r\n return checkAbort();\r\n };\r\n onProgress = throttleProgressCallback(progressCallback, checkAbort, options?.progressInterval);\r\n } else if (options?.enableCancellation) {\r\n onProgress = checkAbort;\r\n }\r\n\r\n try {\r\n await iModelDb.pullChanges({ toIndex, onProgress });\r\n } finally {\r\n this._iModelKeyToPullStatus.delete(key);\r\n }\r\n\r\n return iModelDb.changeset as ChangesetIndexAndId;\r\n }\r\n public async cancelPullChangesRequest(key: string): Promise<void> {\r\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Abort);\r\n }\r\n\r\n public async pushChanges(key: string, description: string): Promise<ChangesetIndexAndId> {\r\n const iModelDb = BriefcaseDb.findByKey(key);\r\n await iModelDb.pushChanges({ description });\r\n return iModelDb.changeset as ChangesetIndexAndId;\r\n }\r\n\r\n public async toggleGraphicalEditingScope(key: string, startSession: boolean): Promise<boolean> {\r\n const val: IModelJsNative.ErrorStatusOrResult<any, boolean> = IModelDb.findByKey(key)[_nativeDb].setGeometricModelTrackingEnabled(startSession);\r\n if (val.error)\r\n throw new IModelError(val.error.status, \"Failed to toggle graphical editing scope\");\r\n assert(undefined !== val.result);\r\n return val.result;\r\n }\r\n public async isGraphicalEditingSupported(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].isGeometricModelTrackingSupported();\r\n }\r\n\r\n public async reverseTxns(key: string, numOperations: number): Promise<IModelStatus> {\r\n return IModelDb.findByKey(key)[_nativeDb].reverseTxns(numOperations);\r\n }\r\n public async reverseAllTxn(key: string): Promise<IModelStatus> {\r\n return IModelDb.findByKey(key)[_nativeDb].reverseAll();\r\n }\r\n public async reinstateTxn(key: string): Promise<IModelStatus> {\r\n return IModelDb.findByKey(key)[_nativeDb].reinstateTxn();\r\n }\r\n public async restartTxnSession(key: string): Promise<void> {\r\n return IModelDb.findByKey(key)[_nativeDb].restartTxnSession();\r\n }\r\n\r\n public async queryConcurrency(pool: \"io\" | \"cpu\"): Promise<number> {\r\n return IModelNative.platform.queryConcurrency(pool);\r\n }\r\n}\r\n\r\n/**\r\n * Prevents progress callback being called more frequently when provided interval.\r\n * @internal\r\n */\r\nexport function throttleProgressCallback(func: ProgressFunction, checkAbort: () => ProgressStatus, progressInterval?: number): ProgressFunction {\r\n const interval = progressInterval ?? 250; // by default, only send progress events every 250 milliseconds\r\n let nextTime = Date.now() + interval;\r\n const progressCallback: ProgressFunction = (loaded, total) => {\r\n const now = Date.now();\r\n if (loaded >= total || now >= nextTime) {\r\n nextTime = now + interval;\r\n return func(loaded, total);\r\n }\r\n return checkAbort();\r\n };\r\n\r\n return progressCallback;\r\n}\r\n"]}
1
+ {"version":3,"file":"IpcHost.js","sourceRoot":"","sources":["../../src/IpcHost.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAY,MAAM,qBAAqB,CAAC;AAChH,OAA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E,CAAC;IACzD,CAAC;IACM,KAAK,CAAC,YAAY,CAAC,GAAW;QACnC,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,CAAC;IAC3D,CAAC;IACM,KAAK,CAAC,iBAAiB,CAAC,GAAW;QACxC,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAChE,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,IAAkB;QAC9C,OAAO,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAsB,EAAE,UAAgC,EAAE,gBAAyB;IAC1H,MAAM,QAAQ,GAAG,gBAAgB,IAAI,GAAG,CAAC,CAAC,+DAA+D;IACzG,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC;IACrC,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;YACvC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { assert, BentleyError, IModelStatus, JsonUtils, Logger, LogLevel, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseConnectionProps,\r\n ChangesetIndex, ChangesetIndexAndId, EditingScopeNotifications, getPullChangesIpcChannel, IModelConnectionProps, IModelError, IModelNotFoundResponse, IModelRpcProps,\r\n ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketBackend, iTwinChannel,\r\n OpenBriefcaseProps, OpenCheckpointArgs, PullChangesOptions, RemoveFunction, SnapshotOpenOptions, StandaloneOpenOptions, TileTreeContentIds, TxnNotifications,\r\n} from \"@itwin/core-common\";\r\nimport { ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\r\nimport { BriefcaseDb, IModelDb, SnapshotDb, StandaloneDb } from \"./IModelDb\";\r\nimport { IModelHost, IModelHostOptions } from \"./IModelHost\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\nimport { cancelTileContentRequests } from \"./rpc-impl/IModelTileRpcImpl\";\r\n\r\n/**\r\n * Options for [[IpcHost.startup]]\r\n * @public\r\n */\r\nexport interface IpcHostOpts {\r\n iModelHost?: IModelHostOptions;\r\n ipcHost?: {\r\n /** The Ipc socket to use for communications with frontend. Allows undefined only for headless tests. */\r\n socket?: IpcSocketBackend;\r\n\r\n /** don't send stack information on exceptions */\r\n exceptions?: {\r\n noStack?: boolean;\r\n };\r\n };\r\n}\r\n\r\n/**\r\n * Used by applications that have a dedicated backend. IpcHosts may send messages to their corresponding IpcApp.\r\n * @note if either end terminates, the other must too.\r\n * @public\r\n */\r\nexport class IpcHost {\r\n public static noStack = false;\r\n private static _ipc: IpcSocketBackend | undefined;\r\n /** Get the implementation of the [IpcSocketBackend]($common) interface. */\r\n private static get ipc(): IpcSocketBackend { return this._ipc!; } // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n /** Determine whether Ipc is available for this backend. This will only be true if [[startup]] has been called on this class. */\r\n public static get isValid(): boolean { return undefined !== this._ipc; }\r\n\r\n /**\r\n * Send a message to the frontend over an Ipc channel.\r\n * @param channel the name of the channel matching the name registered with [[IpcApp.addListener]].\r\n * @param data The content of the message.\r\n */\r\n public static send(channel: string, ...data: any[]): void {\r\n this.ipc.send(iTwinChannel(channel), ...data);\r\n }\r\n\r\n /**\r\n * Establish a handler for an Ipc channel to receive [[Frontend.invoke]] calls\r\n * @param channel The name of the channel for this handler.\r\n * @param handler A function that supplies the implementation for `channel`\r\n * @note returns A function to call to remove the handler.\r\n */\r\n public static handle(channel: string, handler: (...args: any[]) => Promise<any>): RemoveFunction {\r\n return this.ipc.handle(iTwinChannel(channel), handler);\r\n }\r\n /**\r\n * Establish a handler to receive messages sent via [[IpcApp.send]].\r\n * @param channel The name of the channel for the messages.\r\n * @param listener A function called when messages are sent over `channel`\r\n * @note returns A function to call to remove the listener.\r\n */\r\n public static addListener(channel: string, listener: IpcListener): RemoveFunction {\r\n return this.ipc.addListener(iTwinChannel(channel), listener);\r\n }\r\n /**\r\n * Remove a previously registered listener\r\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\r\n * @param listener The function passed to [[addListener]]\r\n */\r\n public static removeListener(channel: string, listener: IpcListener): void {\r\n this.ipc.removeListener(iTwinChannel(channel), listener);\r\n }\r\n\r\n private static notify(channel: string, briefcase: BriefcaseDb | StandaloneDb, methodName: string, ...args: any[]) {\r\n if (this.isValid)\r\n return this.send(`${channel}/${briefcase.key}`, methodName, ...args);\r\n }\r\n\r\n /** @internal */\r\n public static notifyIpcFrontend<T extends keyof IpcAppNotifications>(methodName: T, ...args: Parameters<IpcAppNotifications[T]>) {\r\n return IpcHost.send(ipcAppChannels.appNotify, methodName, ...args);\r\n }\r\n\r\n /** @internal */\r\n public static notifyTxns<T extends keyof TxnNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<TxnNotifications[T]>) {\r\n this.notify(ipcAppChannels.txns, briefcase, methodName, ...args);\r\n }\r\n\r\n /** @internal */\r\n public static notifyEditingScope<T extends keyof EditingScopeNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<EditingScopeNotifications[T]>) {\r\n this.notify(ipcAppChannels.editingScope, briefcase, methodName, ...args);\r\n }\r\n\r\n /**\r\n * Start the backend of an Ipc app.\r\n * @param opt\r\n * @note this method calls [[IModelHost.startup]] internally.\r\n */\r\n public static async startup(opt?: IpcHostOpts): Promise<void> {\r\n this._ipc = opt?.ipcHost?.socket;\r\n if (opt?.ipcHost?.exceptions?.noStack)\r\n this.noStack = true;\r\n\r\n if (this.isValid) { // for tests, we use IpcHost but don't have a frontend\r\n IpcAppHandler.register();\r\n }\r\n\r\n await IModelHost.startup(opt?.iModelHost);\r\n }\r\n\r\n /** Shutdown IpcHost backend. Also calls [[IModelHost.shutdown]] */\r\n public static async shutdown(): Promise<void> {\r\n this._ipc = undefined;\r\n await IModelHost.shutdown();\r\n }\r\n}\r\n\r\n/**\r\n * Base class for all implementations of an Ipc interface.\r\n *\r\n * Create a subclass to implement your Ipc interface. Your class should be declared like this:\r\n * ```ts\r\n * class MyHandler extends IpcHandler implements MyInterface\r\n * ```\r\n * to ensure all methods and signatures are correct.\r\n *\r\n * Then, call `MyClass.register` at startup to connect your class to your channel.\r\n * @public\r\n */\r\nexport abstract class IpcHandler {\r\n /**\r\n * All subclasses *must* implement this method to specify their channel name.\r\n *\r\n * Channel names are the key that connects Handlers and senders. The channel name of IpcHandlers must exactly match the name used by senders.\r\n * By convention, channel names should be prefixed by a *namespace* (e.g. `${appName}/`)\r\n * unique enough to disambiguate them from channels for other apps that may be running in the same processes.\r\n */\r\n public abstract get channelName(): string;\r\n\r\n /**\r\n * Register this class as the handler for methods on its channel. This static method creates a new instance\r\n * that becomes the handler and is `this` when its methods are called.\r\n * @returns A function that can be called to remove the handler.\r\n * @note this method should only be called once per channel. If it is called multiple times, subsequent calls replace the previous ones.\r\n */\r\n public static register(): RemoveFunction {\r\n const impl = new (this as any)() as IpcHandler; // create an instance of subclass. \"as any\" is necessary because base class is abstract\r\n const prohibitedFunctions = Object.getOwnPropertyNames(Object.getPrototypeOf({}));\r\n\r\n return IpcHost.handle(impl.channelName, async (_evt: Event, funcName: string, ...args: any[]): Promise<IpcInvokeReturn> => {\r\n try {\r\n if (prohibitedFunctions.includes(funcName))\r\n throw new Error(`Method \"${funcName}\" not available for channel: ${impl.channelName}`);\r\n\r\n const func = (impl as any)[funcName];\r\n if (typeof func !== \"function\")\r\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${impl.constructor.name}.${funcName}\" not found on IpcHandler registered for channel: ${impl.channelName}`);\r\n\r\n return { result: await func.call(impl, ...args) };\r\n } catch (err: unknown) {\r\n\r\n if (!JsonUtils.isObject(err)) // if the exception isn't an object, just forward it\r\n return { error: err as any };\r\n\r\n const ret = { error: { ...err } };\r\n ret.error.message = err.message; // NB: .message, and .stack members of Error are not enumerable, so spread operator above does not copy them.\r\n if (!IpcHost.noStack)\r\n ret.error.stack = err.stack;\r\n\r\n if (err instanceof BentleyError) {\r\n ret.error.iTwinErrorId = err.iTwinErrorId;\r\n if (err.hasMetaData)\r\n ret.error.loggingMetadata = err.loggingMetadata;\r\n delete ret.error._metaData;\r\n }\r\n return ret;\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Implementation of IpcAppFunctions\r\n */\r\nclass IpcAppHandler extends IpcHandler implements IpcAppFunctions {\r\n public get channelName() { return ipcAppChannels.functions; }\r\n\r\n private _iModelKeyToPullStatus = new Map<string, ProgressStatus>();\r\n\r\n public async log(_timestamp: number, level: LogLevel, category: string, message: string, metaData?: any): Promise<void> {\r\n switch (level) {\r\n case LogLevel.Error:\r\n Logger.logError(category, message, metaData);\r\n break;\r\n case LogLevel.Info:\r\n Logger.logInfo(category, message, metaData);\r\n break;\r\n case LogLevel.Trace:\r\n Logger.logTrace(category, message, metaData);\r\n break;\r\n case LogLevel.Warning:\r\n Logger.logWarning(category, message, metaData);\r\n break;\r\n }\r\n }\r\n\r\n public async cancelTileContentRequests(tokenProps: IModelRpcProps, contentIds: TileTreeContentIds[]): Promise<void> {\r\n return cancelTileContentRequests(tokenProps, contentIds);\r\n }\r\n public async cancelElementGraphicsRequests(key: string, requestIds: string[]): Promise<void> {\r\n return IModelDb.findByKey(key)[_nativeDb].cancelElementGraphicsRequests(requestIds);\r\n }\r\n public async openBriefcase(args: OpenBriefcaseProps): Promise<BriefcaseConnectionProps> {\r\n const db = await BriefcaseDb.open(args);\r\n return db.toJSON();\r\n }\r\n public async openCheckpoint(checkpoint: OpenCheckpointArgs): Promise<IModelConnectionProps> {\r\n return (await SnapshotDb.openCheckpoint(checkpoint)).getConnectionProps();\r\n }\r\n public async openStandalone(filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions): Promise<IModelConnectionProps> {\r\n return StandaloneDb.openFile(filePath, openMode, opts).getConnectionProps();\r\n }\r\n public async openSnapshot(filePath: string, opts?: SnapshotOpenOptions): Promise<IModelConnectionProps> {\r\n let resolvedFileName: string | undefined = filePath;\r\n if (IModelHost.snapshotFileNameResolver) { // eslint-disable-line @typescript-eslint/no-deprecated\r\n resolvedFileName = IModelHost.snapshotFileNameResolver.tryResolveFileName(filePath); // eslint-disable-line @typescript-eslint/no-deprecated\r\n if (!resolvedFileName)\r\n throw new IModelNotFoundResponse(); // eslint-disable-line @typescript-eslint/only-throw-error\r\n }\r\n return SnapshotDb.openFile(resolvedFileName, opts).getConnectionProps();\r\n }\r\n public async closeIModel(key: string): Promise<void> {\r\n IModelDb.findByKey(key).close();\r\n }\r\n public async saveChanges(key: string, description?: string): Promise<void> {\r\n IModelDb.findByKey(key).saveChanges(description);\r\n }\r\n public async abandonChanges(key: string): Promise<void> {\r\n IModelDb.findByKey(key).abandonChanges();\r\n }\r\n public async hasPendingTxns(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].hasPendingTxns();\r\n }\r\n\r\n public async isUndoPossible(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].isUndoPossible();\r\n }\r\n public async isRedoPossible(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].isRedoPossible();\r\n }\r\n public async getUndoString(key: string): Promise<string> {\r\n return IModelDb.findByKey(key)[_nativeDb].getUndoString();\r\n }\r\n public async getRedoString(key: string): Promise<string> {\r\n return IModelDb.findByKey(key)[_nativeDb].getRedoString();\r\n }\r\n\r\n public async pullChanges(key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<ChangesetIndexAndId> {\r\n const iModelDb = BriefcaseDb.findByKey(key);\r\n\r\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Continue);\r\n const checkAbort = () => this._iModelKeyToPullStatus.get(key) ?? ProgressStatus.Continue;\r\n\r\n let onProgress: ProgressFunction | undefined;\r\n if (options?.reportProgress) {\r\n const progressCallback: ProgressFunction = (loaded, total) => {\r\n IpcHost.send(getPullChangesIpcChannel(iModelDb.iModelId), { loaded, total });\r\n return checkAbort();\r\n };\r\n onProgress = throttleProgressCallback(progressCallback, checkAbort, options?.progressInterval);\r\n } else if (options?.enableCancellation) {\r\n onProgress = checkAbort;\r\n }\r\n\r\n try {\r\n await iModelDb.pullChanges({ toIndex, onProgress });\r\n } finally {\r\n this._iModelKeyToPullStatus.delete(key);\r\n }\r\n\r\n return iModelDb.changeset as ChangesetIndexAndId;\r\n }\r\n public async cancelPullChangesRequest(key: string): Promise<void> {\r\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Abort);\r\n }\r\n\r\n public async pushChanges(key: string, description: string): Promise<ChangesetIndexAndId> {\r\n const iModelDb = BriefcaseDb.findByKey(key);\r\n await iModelDb.pushChanges({ description });\r\n return iModelDb.changeset as ChangesetIndexAndId;\r\n }\r\n\r\n public async toggleGraphicalEditingScope(key: string, startSession: boolean): Promise<boolean> {\r\n const val: IModelJsNative.ErrorStatusOrResult<any, boolean> = IModelDb.findByKey(key)[_nativeDb].setGeometricModelTrackingEnabled(startSession);\r\n if (val.error)\r\n throw new IModelError(val.error.status, \"Failed to toggle graphical editing scope\");\r\n assert(undefined !== val.result);\r\n return val.result;\r\n }\r\n public async isGraphicalEditingSupported(key: string): Promise<boolean> {\r\n return IModelDb.findByKey(key)[_nativeDb].isGeometricModelTrackingSupported();\r\n }\r\n\r\n public async reverseTxns(key: string, numOperations: number): Promise<IModelStatus> {\r\n return IModelDb.findByKey(key)[_nativeDb].reverseTxns(numOperations);\r\n }\r\n public async reverseAllTxn(key: string): Promise<IModelStatus> {\r\n return IModelDb.findByKey(key)[_nativeDb].reverseAll();\r\n }\r\n public async reinstateTxn(key: string): Promise<IModelStatus> {\r\n return IModelDb.findByKey(key)[_nativeDb].reinstateTxn();\r\n }\r\n public async restartTxnSession(key: string): Promise<void> {\r\n return IModelDb.findByKey(key)[_nativeDb].restartTxnSession();\r\n }\r\n\r\n public async queryConcurrency(pool: \"io\" | \"cpu\"): Promise<number> {\r\n return IModelNative.platform.queryConcurrency(pool);\r\n }\r\n}\r\n\r\n/**\r\n * Prevents progress callback being called more frequently when provided interval.\r\n * @internal\r\n */\r\nexport function throttleProgressCallback(func: ProgressFunction, checkAbort: () => ProgressStatus, progressInterval?: number): ProgressFunction {\r\n const interval = progressInterval ?? 250; // by default, only send progress events every 250 milliseconds\r\n let nextTime = Date.now() + interval;\r\n const progressCallback: ProgressFunction = (loaded, total) => {\r\n const now = Date.now();\r\n if (loaded >= total || now >= nextTime) {\r\n nextTime = now + interval;\r\n return func(loaded, total);\r\n }\r\n return checkAbort();\r\n };\r\n\r\n return progressCallback;\r\n}\r\n"]}
@@ -291,6 +291,8 @@ export declare namespace LineStyleDefinition {
291
291
  * @throws [[IModelError]] if unable to insert the line style definition element.
292
292
  */
293
293
  static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;
294
+ /** Get the name that can be use to query for an existing continuous line style. */
295
+ static getContinuousStyleName(width?: number): string;
294
296
  /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.
295
297
  * There are 2 ways to define a continuous line style:
296
298
  * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.
@@ -301,6 +303,10 @@ export declare namespace LineStyleDefinition {
301
303
  * @throws [[IModelError]] if unable to insert the line style definition element.
302
304
  */
303
305
  static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number): Id64String;
306
+ /** Get the name that can be use to query for an existing [[LinePixels]] line style.
307
+ * @note Returns undefined for line pixels value that is not Code1 to Code7.
308
+ */
309
+ static getLinePixelsStyleName(linePixels: LinePixels): string | undefined;
304
310
  /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.
305
311
  * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.
306
312
  * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.
@@ -1 +1 @@
1
- {"version":3,"file":"LineStyle.d.ts","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAkC,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;GASG;AACH,yBAAiB,mBAAmB,CAAC;IAEnC,4CAA4C;IAC5C,KAAY,aAAa;QACvB,kEAAkE;QAClE,WAAW,IAAI;QACf,+DAA+D;QAC/D,QAAQ,IAAI;QACZ,oEAAoE;QACpE,aAAa,IAAI;QACjB,kEAAkE;QAClE,WAAW,IAAI;QACf,wEAAwE;QACxE,QAAQ,IAAI;QACZ,kEAAkE;QAClE,WAAW,IAAI;KAChB;IAED,oCAAoC;IACpC,KAAY,UAAU;QACpB,sCAAsC;QACtC,GAAG,IAAO;QACV,qCAAqC;QACrC,IAAI,IAAO;QACX,mHAAmH;QACnH,GAAG,IA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;WAQG;eACW,0BAA0B,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU;QAgBhH;;UAEE;eACY,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;QAQhF;;;;WAIG;eACW,0BAA0B,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,UAAU;KASzH;CACF"}
@@ -8,6 +8,26 @@
8
8
  import { IModelStatus } from "@itwin/core-bentley";
9
9
  import { IModelError, LinePixels } from "@itwin/core-common";
10
10
  import { LineStyle } from "./Element";
11
+ function getLinePixelsLineCode(linePixels) {
12
+ switch (linePixels) {
13
+ case LinePixels.Code1:
14
+ return 1;
15
+ case LinePixels.Code2:
16
+ return 2;
17
+ case LinePixels.Code3:
18
+ return 3;
19
+ case LinePixels.Code4:
20
+ return 4;
21
+ case LinePixels.Code5:
22
+ return 5;
23
+ case LinePixels.Code6:
24
+ return 6;
25
+ case LinePixels.Code7:
26
+ return 7;
27
+ default:
28
+ return -1; // Invalid value...
29
+ }
30
+ }
11
31
  /** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.
12
32
  * There are three varieties of line styles:
13
33
  * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.
@@ -227,6 +247,12 @@ export var LineStyleDefinition;
227
247
  };
228
248
  return imodel.elements.insertElement(lsProps);
229
249
  }
250
+ /** Get the name that can be use to query for an existing continuous line style. */
251
+ static getContinuousStyleName(width) {
252
+ if (width === undefined)
253
+ return "Continuous";
254
+ return `Continuous-${width}`;
255
+ }
230
256
  /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.
231
257
  * There are 2 ways to define a continuous line style:
232
258
  * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.
@@ -237,52 +263,35 @@ export var LineStyleDefinition;
237
263
  * @throws [[IModelError]] if unable to insert the line style definition element.
238
264
  */
239
265
  static getOrCreateContinuousStyle(imodel, scopeModelId, width) {
240
- if (width === undefined) {
241
- const name0 = "Continuous";
242
- const lsId0 = this.queryStyle(imodel, scopeModelId, name0);
243
- return (undefined === lsId0 ? this.createStyle(imodel, scopeModelId, name0, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap }) : lsId0);
244
- }
245
- const name = `Continuous-${width}`;
266
+ const name = this.getContinuousStyleName(width);
246
267
  const lsId = this.queryStyle(imodel, scopeModelId, name);
247
268
  if (undefined !== lsId)
248
269
  return lsId;
270
+ if (width === undefined)
271
+ return this.createStyle(imodel, scopeModelId, name, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap });
249
272
  const strokePatternData = this.createStrokePatternComponent(imodel, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });
250
273
  if (undefined === strokePatternData)
251
274
  throw new IModelError(IModelStatus.BadArg, "Unable to insert stroke component");
252
275
  return this.createStyle(imodel, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });
253
276
  }
277
+ /** Get the name that can be use to query for an existing [[LinePixels]] line style.
278
+ * @note Returns undefined for line pixels value that is not Code1 to Code7.
279
+ */
280
+ static getLinePixelsStyleName(linePixels) {
281
+ const lineCode = getLinePixelsLineCode(linePixels);
282
+ if (-1 === lineCode)
283
+ return undefined;
284
+ return `LinePixelsCodeNumber-${lineCode}`;
285
+ }
254
286
  /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.
255
287
  * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.
256
288
  * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.
257
289
  * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.
258
290
  */
259
291
  static getOrCreateLinePixelsStyle(imodel, scopeModelId, linePixels) {
260
- let lineCode;
261
- switch (linePixels) {
262
- case LinePixels.Code1:
263
- lineCode = 1;
264
- break;
265
- case LinePixels.Code2:
266
- lineCode = 2;
267
- break;
268
- case LinePixels.Code3:
269
- lineCode = 3;
270
- break;
271
- case LinePixels.Code4:
272
- lineCode = 4;
273
- break;
274
- case LinePixels.Code5:
275
- lineCode = 5;
276
- break;
277
- case LinePixels.Code6:
278
- lineCode = 6;
279
- break;
280
- case LinePixels.Code7:
281
- lineCode = 7;
282
- break;
283
- default:
284
- throw new IModelError(IModelStatus.BadArg, "Invalid LinePixels");
285
- }
292
+ const lineCode = getLinePixelsLineCode(linePixels);
293
+ if (-1 === lineCode)
294
+ throw new IModelError(IModelStatus.BadArg, "Invalid LinePixels");
286
295
  const name = `LinePixelsCodeNumber-${lineCode}`;
287
296
  const lsId = this.queryStyle(imodel, scopeModelId, name);
288
297
  return (undefined === lsId ? this.createStyle(imodel, scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);
@@ -1 +1 @@
1
- {"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAqB,WAAW,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAgB,SAAS,EAAE,MAAM,WAAW,CAAC;AAGpD;;;;;;;;;GASG;AACH,MAAM,KAAW,mBAAmB,CA6anC;AA7aD,WAAiB,mBAAmB;IAElC,4CAA4C;IAC5C,IAAY,aAaX;IAbD,WAAY,aAAa;QACvB,kEAAkE;QAClE,+DAAe,CAAA;QACf,+DAA+D;QAC/D,yDAAY,CAAA;QACZ,oEAAoE;QACpE,mEAAiB,CAAA;QACjB,kEAAkE;QACl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AQ,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACzD,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5I,CAAC;KACF;IArJY,yBAAK,QAqJjB,CAAA;AACH,CAAC,EA7agB,mBAAmB,KAAnB,mBAAmB,QA6anC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementGeometry\r\n */\r\n\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { FilePropertyProps, IModelError, LinePixels, LineStyleProps } from \"@itwin/core-common\";\r\nimport { GeometryPart, LineStyle } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\n/** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.\r\n * There are three varieties of line styles:\r\n * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.\r\n * - A style using pre-defined pixel bit patterns [[LinePixels]] for dashed display (Code1-Code7).\r\n * - A style that uses a texture.\r\n *\r\n * A definition is defined by one or more components. A component is saved as a \"file property\" and can be referenced by other components. The line style definition references a component\r\n * by file property id and type and is saved as a dictionary element.\r\n * @public\r\n */\r\nexport namespace LineStyleDefinition {\r\n\r\n /** Line style component type identifiers */\r\n export enum ComponentType {\r\n /** Component type for [[LineStyleDefinition.PointSymbolProps]] */\r\n PointSymbol = 1,\r\n /** Component type for [[LineStyleDefinition.CompoundProps]] */\r\n Compound = 2,\r\n /** Component type for [[LineStyleDefinition.StrokePatternProps]] */\r\n StrokePattern = 3,\r\n /** Component type for [[LineStyleDefinition.StrokePointProps]] */\r\n StrokePoint = 4,\r\n /** Component type for [[LinePixels]], never saved as a file property */\r\n Internal = 6,\r\n /** Component type for [[LineStyleDefinition.RasterImageProps]] */\r\n RasterImage = 7,\r\n }\r\n\r\n /** Mask of values for StrokeMode */\r\n export enum StrokeMode {\r\n /** Stroke represents a blank space */\r\n Gap = 0x00,\r\n /** Stroke represents a solid dash */\r\n Dash = 0x01,\r\n /** Treat stroke as rigid and continue past a corner to complete the stroke as opposed to breaking at the corner */\r\n Ray = 0x02,\r\n /** Stroke length can be stretched when [[LineStyleDefinition.StrokePatternOptions.Iteration]] and [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] options are set, applicable to both Gap and Dash strokes */\r\n Scale = 0x04,\r\n /** Invert stroke in first stroke pattern */\r\n FirstInvert = 0x08,\r\n /** Invert stroke in last stroke pattern */\r\n LastInvert = 0x10,\r\n }\r\n\r\n /** Define constant width or tapered strokes with distance specified in meters */\r\n export enum StrokeWidth {\r\n /** Stroke draws as one pixel wide line */\r\n None = 0,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to left side of stroke */\r\n Left = 1,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to right side of stroke */\r\n Right = 2,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to both sides of stroke */\r\n Full = 3,\r\n }\r\n\r\n /** Controls appearance of stroke end caps. If StrokeCap is >= Hexagon, the end cap is stroked as an arc and the value of\r\n * StrokeCap indicates the number of vectors in the arc.\r\n */\r\n export enum StrokeCap {\r\n /** Stroke displays as a closed polygon */\r\n Closed = 0,\r\n /** Stroke displays lines at specified width instead of a polygon */\r\n Open = 1,\r\n /** Stroke length extended by half the stroke width */\r\n Extended = 2,\r\n /** Stroke end cap is a hexagon */\r\n Hexagon = 3,\r\n /** Stroke end cap is an octagon */\r\n Octagon = 4,\r\n /** Stroke end cap is a decagon */\r\n Decagon = 5,\r\n /** Stroke end cap is an arc */\r\n Arc = 30,\r\n }\r\n\r\n /** A stroke representing either a dash or gap in a stroke pattern */\r\n export interface StrokeProps {\r\n /** Length of stroke in meters */\r\n length: number;\r\n /** Width at start of stroke. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n orgWidth?: number;\r\n /** Width at end of stroke, same as start width if not present. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n endWidth?: number;\r\n /** Type and behavior of stroke */\r\n strokeMode?: StrokeMode;\r\n /** How to apply orgWidth and endWidth to stroke */\r\n widthMode?: StrokeWidth;\r\n /** Appearance of stroke end cap */\r\n capMode?: StrokeCap;\r\n }\r\n\r\n export type Strokes = StrokeProps[];\r\n\r\n /** Options to control how stroke pattern is applied to underlying curve */\r\n export enum StrokePatternOptions {\r\n /** Use default stroke behavior */\r\n None = 0x00,\r\n /** [[LineStyleDefinition.StrokePatternProps.phase]] represents fractional distance into first stroke of pattern */\r\n AutoPhase = 0x01,\r\n /** Use [[LineStyleDefinition.StrokePatternProps.maxIter]] to limit the number of iterations of the stroke pattern */\r\n Iteration = 0x08,\r\n /** Single segment mode restarts the stroke pattern at corners instead of continuing around corners */\r\n Segment = 0x10,\r\n /** Center the line style and stretch the ends */\r\n CenterStretch = 0x20,\r\n }\r\n\r\n /** Stroke pattern component definition [[LineStyleDefinition.ComponentType.StrokePattern]].\r\n * A stroke pattern component consists of a series of dashes and gaps having specified lengths and widths in meters. Simple dash-dot type line styles that do not\r\n * include point symbols can be created by referencing a stroke pattern component by its file property id.\r\n */\r\n export interface StrokePatternProps {\r\n /** Name for this stroke pattern */\r\n descr: string;\r\n /** Skip into the pattern before starting to draw. Value treated as fraction of the first stroke when [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] set. Value used as distance when [[LineStyleDefinition.StrokePatternOptions.CenterStretch]] is not set. */\r\n phase?: number;\r\n /** Options mask for this stroke pattern */\r\n options?: StrokePatternOptions;\r\n /** The entire stroke pattern will be repeated no more than maxIter on curve or segment when [[LineStyleDefinition.StrokePatternOptions.Iteration]] is set and stroke pattern includes stretchable strokes. */\r\n maxIter?: number;\r\n /** Array of strokes, maximum number that will be used is 32 */\r\n strokes: Strokes;\r\n }\r\n\r\n /** Flags to identify point symbol behavior */\r\n export enum PointSymbolFlags {\r\n /** Default symbol behavior */\r\n None = 0x0,\r\n /** Symbol includes 3d geometry */\r\n Is3d = 0x01,\r\n /** Symbol does not allow scaling */\r\n NoScale = 0x02,\r\n }\r\n\r\n /** Point symbol component definition [[LineStyleDefinition.ComponentType.PointSymbol]].\r\n * A point symbol component identifies a GeometryPart for reference by a [[LineStyleDefinition.SymbolProps]].\r\n */\r\n export interface PointSymbolProps {\r\n /** GeometryPart Id to use as a pattern symbol */\r\n geomPartId: Id64String;\r\n /** GeometryPart.bbox.low.x */\r\n baseX?: number;\r\n /** GeometryPart.bbox.low.y */\r\n baseY?: number;\r\n /** GeometryPart.bbox.low.z */\r\n baseZ?: number;\r\n /** GeometryPart.bbox.high.x */\r\n sizeX?: number;\r\n /** GeometryPart.bbox.high.y */\r\n sizeY?: number;\r\n /** GeometryPart.bbox.high.z */\r\n sizeZ?: number;\r\n /** Symbol behavior flags */\r\n symFlags?: PointSymbolFlags;\r\n /** Symbol scale, defaults to 1 */\r\n scale?: number;\r\n }\r\n\r\n /** Symbol options for location, orientation, and behavior */\r\n export enum SymbolOptions {\r\n /** No point symbol */\r\n None = 0x00,\r\n /** Symbol at origin of stroke */\r\n Origin = 0x01,\r\n /** Symbol at end of stroke */\r\n End = 0x02,\r\n /** symbol at center of stroke */\r\n Center = 0x03,\r\n /** Symbol at curve start point */\r\n CurveOrigin = 0x0004,\r\n /** Symbol at curve end point */\r\n CurveEnd = 0x0008,\r\n /** Symbol at each vertex */\r\n CurveVertex = 0x0010,\r\n /** Adjust symbol rotation left->right */\r\n AdjustRotation = 0x0020,\r\n /** Angle of symbol not relative to stroke direction */\r\n AbsoluteRotation = 0x0040,\r\n /** No scale on variable strokes */\r\n NoScale = 0x0100,\r\n /** No clip on partial strokes */\r\n NoClip = 0x0200,\r\n /** No partial strokes */\r\n NoPartial = 0x0400,\r\n /** Project partial origin */\r\n ProjectOrigin = 0x0800,\r\n /** Use color from symbol instead of inheriting curve color */\r\n UseColor = 0x4000,\r\n /** Use weight from symbol instead of inheriting curve weight */\r\n UseWeight = 0x8000,\r\n }\r\n\r\n /** Identifies a symbol and its location and orientation relative to a stroke pattern */\r\n export interface SymbolProps {\r\n /** The file property id of the symbol component, assumed to be [[LineStyleDefinition.ComponentType.PointSymbol]] if symType is undefined. */\r\n symId: number;\r\n /** The component type, leave undefined if symId is a [[LineStyleDefinition.ComponentType.PointSymbol]] */\r\n symType?: ComponentType;\r\n /** The 0 based stroke index for base stroke pattern [[LineStyleDefinition.ComponentType.StrokePattern]] component */\r\n strokeNum?: number;\r\n /** Symbol x offset distance in meters */\r\n xOffset?: number;\r\n /** Symbol y offset distance in meters */\r\n yOffset?: number;\r\n /** Symbol rotation in radians */\r\n angle?: number;\r\n /** Must set location for symbol as default value is [[LineStyleDefinition.SymbolOptions.None]] */\r\n mod1?: SymbolOptions;\r\n }\r\n\r\n export type Symbols = SymbolProps[];\r\n\r\n /** Stroke point component definition [[LineStyleDefinition.ComponentType.StrokePoint]].\r\n * A stroke point component identifies the locations of point symbol components relative to a base stroke pattern component.\r\n */\r\n export interface StrokePointProps {\r\n /** Name for this stroke point component */\r\n descr: string;\r\n /** The file property id of the stroke component, assumed to be [[LineStyleDefinition.ComponentType.StrokePattern]] if lcType is undefined */\r\n lcId: number;\r\n /** The component type, leave undefined if lcId is a [[LineStyleDefinition.ComponentType.StrokePattern]] */\r\n lcType?: ComponentType;\r\n /** Array of symbols */\r\n symbols: Symbols;\r\n }\r\n\r\n /** Raster component definition [[LineStyleDefinition.ComponentType.RasterImage]].\r\n * A raster component identifies a texture for a line style.\r\n */\r\n export interface RasterImageProps {\r\n /** Name for this raster image component */\r\n descr: string;\r\n /** Raster width */\r\n x: number;\r\n /** Raster height */\r\n y: number;\r\n /** True width flag */\r\n trueWidth?: number;\r\n /** Raster flags */\r\n flags?: number;\r\n /** The file property id of raster image */\r\n imageId?: number;\r\n }\r\n\r\n /** Identifies a component by file property id and type */\r\n export interface ComponentProps {\r\n /** The file property id of [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.StrokePoint]] component */\r\n id: number;\r\n /** The type of component for specified file property id */\r\n type: ComponentType;\r\n /** Offset distance for this component, default is 0 */\r\n offset?: number;\r\n }\r\n\r\n export type Components = ComponentProps[];\r\n\r\n /** Compound component definition [[LineStyleDefinition.ComponentType.Compound]].\r\n * A compound component is used to link stroke pattern and stroke point components to create a style that displays dashes, gaps, and symbols.\r\n */\r\n export interface CompoundProps {\r\n comps: Components;\r\n }\r\n\r\n /** Flags to describe a style or control style behavior */\r\n export enum StyleFlags {\r\n /** Use defaults */\r\n None = 0x00,\r\n /** Only snap to center line and not individual strokes and symbols of line style */\r\n NoSnap = 0x04,\r\n /** Style represents a continuous line with width (determined by looking at components if not set) */\r\n Continuous = 0x08,\r\n /** Style represents physical geometry and should be scaled as such */\r\n Physical = 0x80,\r\n }\r\n\r\n /** The line style definition element data */\r\n export interface StyleProps {\r\n /** The file property id for either a [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.Compound]] component */\r\n compId: number;\r\n /** The type of component for specified file property id */\r\n compType: ComponentType;\r\n /** Style behavior flags. Defaults to [[LineStyleDefinition.StyleFlags.NoSnap]] if left undefined */\r\n flags?: StyleFlags;\r\n /** Style scale, defaults to 1 */\r\n unitDef?: number;\r\n }\r\n\r\n /** Helper methods for creating and querying line styles */\r\n export class Utils {\r\n\r\n /** Create a file property for a new stroke pattern component. */\r\n public static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"LineCodeV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePattern };\r\n }\r\n\r\n /** Create a file property for a new point symbol component.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n */\r\n public static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined {\r\n // if part extents weren't supplied, set them up now.\r\n if (!props.baseX && !props.baseY && !props.baseZ && !props.sizeX && !props.sizeY && !props.sizeZ) {\r\n const geomPart = iModel.elements.getElement<GeometryPart>(props.geomPartId);\r\n if (!geomPart)\r\n return undefined;\r\n\r\n props.baseX = geomPart.bbox.low.x;\r\n props.baseY = geomPart.bbox.low.y;\r\n props.baseZ = geomPart.bbox.low.z;\r\n\r\n props.sizeX = geomPart.bbox.high.x;\r\n props.sizeY = geomPart.bbox.high.y;\r\n props.sizeZ = geomPart.bbox.high.z;\r\n }\r\n\r\n const fileProps: FilePropertyProps = { name: \"PointSymV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.PointSymbol };\r\n }\r\n\r\n /** Create a file property for a new stroke point component. */\r\n public static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"LinePointV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePoint };\r\n }\r\n\r\n /** Create a file property for a new compound component. */\r\n public static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"CompoundV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.Compound };\r\n }\r\n\r\n /** Create a file property for a new raster image component. */\r\n public static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined {\r\n const rasterFileProps: FilePropertyProps = { name: \"RasterImageV1\", namespace: \"dgn_LStyle\" };\r\n rasterFileProps.id = iModel.queryNextAvailableFileProperty(rasterFileProps);\r\n iModel.saveFileProperty(rasterFileProps, undefined, image);\r\n props.imageId = rasterFileProps.id;\r\n const fileProps: FilePropertyProps = { name: \"RasterComponentV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.RasterImage };\r\n }\r\n\r\n /** Query for an existing line style with the supplied name. */\r\n public static queryStyle(imodel: IModelDb, scopeModelId: Id64String, name: string): Id64String | undefined {\r\n return imodel.elements.queryElementIdByCode(LineStyle.createCode(imodel, scopeModelId, name));\r\n }\r\n\r\n /** Insert a new line style with the supplied name.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n */\r\n public static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String {\r\n if (undefined === props.flags)\r\n props.flags = StyleFlags.NoSnap; // If flags weren't supplied, default to not snapping to stroke geometry.\r\n\r\n const lsProps: LineStyleProps = {\r\n classFullName: \"BisCore:LineStyle\",\r\n model: scopeModelId,\r\n code: LineStyle.createCode(imodel, scopeModelId, name),\r\n data: JSON.stringify(props),\r\n };\r\n\r\n return imodel.elements.insertElement(lsProps);\r\n }\r\n\r\n /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.\r\n * There are 2 ways to define a continuous line style:\r\n * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.\r\n * - Defined using [[LineStyleDefinition.ComponentType.Internal]] with component id 0 [[LinePixels.Solid]] which has special behavior of being affected by width overrides.\r\n * - Width is specified in the style.\r\n * - Defined using a single stroke component that is a long dash.\r\n *\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n */\r\n public static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number): Id64String {\r\n if (width === undefined) {\r\n const name0 = \"Continuous\";\r\n const lsId0 = this.queryStyle(imodel, scopeModelId, name0);\r\n return (undefined === lsId0 ? this.createStyle(imodel, scopeModelId, name0, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap }) : lsId0);\r\n }\r\n\r\n const name = `Continuous-${width}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n if (undefined !== lsId)\r\n return lsId;\r\n\r\n const strokePatternData = this.createStrokePatternComponent(imodel, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });\r\n if (undefined === strokePatternData)\r\n throw new IModelError(IModelStatus.BadArg, \"Unable to insert stroke component\");\r\n\r\n return this.createStyle(imodel, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n }\r\n\r\n /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.\r\n * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.\r\n * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.\r\n * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.\r\n */\r\n public static getOrCreateLinePixelsStyle(imodel: IModelDb, scopeModelId: Id64String, linePixels: LinePixels): Id64String {\r\n let lineCode;\r\n switch (linePixels) {\r\n case LinePixels.Code1:\r\n lineCode = 1;\r\n break;\r\n case LinePixels.Code2:\r\n lineCode = 2;\r\n break;\r\n case LinePixels.Code3:\r\n lineCode = 3;\r\n break;\r\n case LinePixels.Code4:\r\n lineCode = 4;\r\n break;\r\n case LinePixels.Code5:\r\n lineCode = 5;\r\n break;\r\n case LinePixels.Code6:\r\n lineCode = 6;\r\n break;\r\n case LinePixels.Code7:\r\n lineCode = 7;\r\n break;\r\n default:\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid LinePixels\");\r\n }\r\n const name = `LinePixelsCodeNumber-${lineCode}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n return (undefined === lsId ? this.createStyle(imodel, scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAqB,WAAW,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAgB,SAAS,EAAE,MAAM,WAAW,CAAC;AAGpD,SAAS,qBAAqB,CAAC,UAAsB;IACnD,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU,CAAC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,MAAM,IAAI,GAAG,wBAAwB,QAAQ,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACzD,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5I,CAAC;KACF;IA/IY,yBAAK,QA+IjB,CAAA;AACH,CAAC,EAvagB,mBAAmB,KAAnB,mBAAmB,QAuanC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementGeometry\r\n */\r\n\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { FilePropertyProps, IModelError, LinePixels, LineStyleProps } from \"@itwin/core-common\";\r\nimport { GeometryPart, LineStyle } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nfunction getLinePixelsLineCode(linePixels: LinePixels): number {\r\n switch (linePixels) {\r\n case LinePixels.Code1:\r\n return 1;\r\n case LinePixels.Code2:\r\n return 2;\r\n case LinePixels.Code3:\r\n return 3;\r\n case LinePixels.Code4:\r\n return 4;\r\n case LinePixels.Code5:\r\n return 5;\r\n case LinePixels.Code6:\r\n return 6;\r\n case LinePixels.Code7:\r\n return 7;\r\n default:\r\n return -1; // Invalid value...\r\n }\r\n}\r\n\r\n/** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.\r\n * There are three varieties of line styles:\r\n * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.\r\n * - A style using pre-defined pixel bit patterns [[LinePixels]] for dashed display (Code1-Code7).\r\n * - A style that uses a texture.\r\n *\r\n * A definition is defined by one or more components. A component is saved as a \"file property\" and can be referenced by other components. The line style definition references a component\r\n * by file property id and type and is saved as a dictionary element.\r\n * @public\r\n */\r\nexport namespace LineStyleDefinition {\r\n\r\n /** Line style component type identifiers */\r\n export enum ComponentType {\r\n /** Component type for [[LineStyleDefinition.PointSymbolProps]] */\r\n PointSymbol = 1,\r\n /** Component type for [[LineStyleDefinition.CompoundProps]] */\r\n Compound = 2,\r\n /** Component type for [[LineStyleDefinition.StrokePatternProps]] */\r\n StrokePattern = 3,\r\n /** Component type for [[LineStyleDefinition.StrokePointProps]] */\r\n StrokePoint = 4,\r\n /** Component type for [[LinePixels]], never saved as a file property */\r\n Internal = 6,\r\n /** Component type for [[LineStyleDefinition.RasterImageProps]] */\r\n RasterImage = 7,\r\n }\r\n\r\n /** Mask of values for StrokeMode */\r\n export enum StrokeMode {\r\n /** Stroke represents a blank space */\r\n Gap = 0x00,\r\n /** Stroke represents a solid dash */\r\n Dash = 0x01,\r\n /** Treat stroke as rigid and continue past a corner to complete the stroke as opposed to breaking at the corner */\r\n Ray = 0x02,\r\n /** Stroke length can be stretched when [[LineStyleDefinition.StrokePatternOptions.Iteration]] and [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] options are set, applicable to both Gap and Dash strokes */\r\n Scale = 0x04,\r\n /** Invert stroke in first stroke pattern */\r\n FirstInvert = 0x08,\r\n /** Invert stroke in last stroke pattern */\r\n LastInvert = 0x10,\r\n }\r\n\r\n /** Define constant width or tapered strokes with distance specified in meters */\r\n export enum StrokeWidth {\r\n /** Stroke draws as one pixel wide line */\r\n None = 0,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to left side of stroke */\r\n Left = 1,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to right side of stroke */\r\n Right = 2,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to both sides of stroke */\r\n Full = 3,\r\n }\r\n\r\n /** Controls appearance of stroke end caps. If StrokeCap is >= Hexagon, the end cap is stroked as an arc and the value of\r\n * StrokeCap indicates the number of vectors in the arc.\r\n */\r\n export enum StrokeCap {\r\n /** Stroke displays as a closed polygon */\r\n Closed = 0,\r\n /** Stroke displays lines at specified width instead of a polygon */\r\n Open = 1,\r\n /** Stroke length extended by half the stroke width */\r\n Extended = 2,\r\n /** Stroke end cap is a hexagon */\r\n Hexagon = 3,\r\n /** Stroke end cap is an octagon */\r\n Octagon = 4,\r\n /** Stroke end cap is a decagon */\r\n Decagon = 5,\r\n /** Stroke end cap is an arc */\r\n Arc = 30,\r\n }\r\n\r\n /** A stroke representing either a dash or gap in a stroke pattern */\r\n export interface StrokeProps {\r\n /** Length of stroke in meters */\r\n length: number;\r\n /** Width at start of stroke. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n orgWidth?: number;\r\n /** Width at end of stroke, same as start width if not present. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n endWidth?: number;\r\n /** Type and behavior of stroke */\r\n strokeMode?: StrokeMode;\r\n /** How to apply orgWidth and endWidth to stroke */\r\n widthMode?: StrokeWidth;\r\n /** Appearance of stroke end cap */\r\n capMode?: StrokeCap;\r\n }\r\n\r\n export type Strokes = StrokeProps[];\r\n\r\n /** Options to control how stroke pattern is applied to underlying curve */\r\n export enum StrokePatternOptions {\r\n /** Use default stroke behavior */\r\n None = 0x00,\r\n /** [[LineStyleDefinition.StrokePatternProps.phase]] represents fractional distance into first stroke of pattern */\r\n AutoPhase = 0x01,\r\n /** Use [[LineStyleDefinition.StrokePatternProps.maxIter]] to limit the number of iterations of the stroke pattern */\r\n Iteration = 0x08,\r\n /** Single segment mode restarts the stroke pattern at corners instead of continuing around corners */\r\n Segment = 0x10,\r\n /** Center the line style and stretch the ends */\r\n CenterStretch = 0x20,\r\n }\r\n\r\n /** Stroke pattern component definition [[LineStyleDefinition.ComponentType.StrokePattern]].\r\n * A stroke pattern component consists of a series of dashes and gaps having specified lengths and widths in meters. Simple dash-dot type line styles that do not\r\n * include point symbols can be created by referencing a stroke pattern component by its file property id.\r\n */\r\n export interface StrokePatternProps {\r\n /** Name for this stroke pattern */\r\n descr: string;\r\n /** Skip into the pattern before starting to draw. Value treated as fraction of the first stroke when [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] set. Value used as distance when [[LineStyleDefinition.StrokePatternOptions.CenterStretch]] is not set. */\r\n phase?: number;\r\n /** Options mask for this stroke pattern */\r\n options?: StrokePatternOptions;\r\n /** The entire stroke pattern will be repeated no more than maxIter on curve or segment when [[LineStyleDefinition.StrokePatternOptions.Iteration]] is set and stroke pattern includes stretchable strokes. */\r\n maxIter?: number;\r\n /** Array of strokes, maximum number that will be used is 32 */\r\n strokes: Strokes;\r\n }\r\n\r\n /** Flags to identify point symbol behavior */\r\n export enum PointSymbolFlags {\r\n /** Default symbol behavior */\r\n None = 0x0,\r\n /** Symbol includes 3d geometry */\r\n Is3d = 0x01,\r\n /** Symbol does not allow scaling */\r\n NoScale = 0x02,\r\n }\r\n\r\n /** Point symbol component definition [[LineStyleDefinition.ComponentType.PointSymbol]].\r\n * A point symbol component identifies a GeometryPart for reference by a [[LineStyleDefinition.SymbolProps]].\r\n */\r\n export interface PointSymbolProps {\r\n /** GeometryPart Id to use as a pattern symbol */\r\n geomPartId: Id64String;\r\n /** GeometryPart.bbox.low.x */\r\n baseX?: number;\r\n /** GeometryPart.bbox.low.y */\r\n baseY?: number;\r\n /** GeometryPart.bbox.low.z */\r\n baseZ?: number;\r\n /** GeometryPart.bbox.high.x */\r\n sizeX?: number;\r\n /** GeometryPart.bbox.high.y */\r\n sizeY?: number;\r\n /** GeometryPart.bbox.high.z */\r\n sizeZ?: number;\r\n /** Symbol behavior flags */\r\n symFlags?: PointSymbolFlags;\r\n /** Symbol scale, defaults to 1 */\r\n scale?: number;\r\n }\r\n\r\n /** Symbol options for location, orientation, and behavior */\r\n export enum SymbolOptions {\r\n /** No point symbol */\r\n None = 0x00,\r\n /** Symbol at origin of stroke */\r\n Origin = 0x01,\r\n /** Symbol at end of stroke */\r\n End = 0x02,\r\n /** symbol at center of stroke */\r\n Center = 0x03,\r\n /** Symbol at curve start point */\r\n CurveOrigin = 0x0004,\r\n /** Symbol at curve end point */\r\n CurveEnd = 0x0008,\r\n /** Symbol at each vertex */\r\n CurveVertex = 0x0010,\r\n /** Adjust symbol rotation left->right */\r\n AdjustRotation = 0x0020,\r\n /** Angle of symbol not relative to stroke direction */\r\n AbsoluteRotation = 0x0040,\r\n /** No scale on variable strokes */\r\n NoScale = 0x0100,\r\n /** No clip on partial strokes */\r\n NoClip = 0x0200,\r\n /** No partial strokes */\r\n NoPartial = 0x0400,\r\n /** Project partial origin */\r\n ProjectOrigin = 0x0800,\r\n /** Use color from symbol instead of inheriting curve color */\r\n UseColor = 0x4000,\r\n /** Use weight from symbol instead of inheriting curve weight */\r\n UseWeight = 0x8000,\r\n }\r\n\r\n /** Identifies a symbol and its location and orientation relative to a stroke pattern */\r\n export interface SymbolProps {\r\n /** The file property id of the symbol component, assumed to be [[LineStyleDefinition.ComponentType.PointSymbol]] if symType is undefined. */\r\n symId: number;\r\n /** The component type, leave undefined if symId is a [[LineStyleDefinition.ComponentType.PointSymbol]] */\r\n symType?: ComponentType;\r\n /** The 0 based stroke index for base stroke pattern [[LineStyleDefinition.ComponentType.StrokePattern]] component */\r\n strokeNum?: number;\r\n /** Symbol x offset distance in meters */\r\n xOffset?: number;\r\n /** Symbol y offset distance in meters */\r\n yOffset?: number;\r\n /** Symbol rotation in radians */\r\n angle?: number;\r\n /** Must set location for symbol as default value is [[LineStyleDefinition.SymbolOptions.None]] */\r\n mod1?: SymbolOptions;\r\n }\r\n\r\n export type Symbols = SymbolProps[];\r\n\r\n /** Stroke point component definition [[LineStyleDefinition.ComponentType.StrokePoint]].\r\n * A stroke point component identifies the locations of point symbol components relative to a base stroke pattern component.\r\n */\r\n export interface StrokePointProps {\r\n /** Name for this stroke point component */\r\n descr: string;\r\n /** The file property id of the stroke component, assumed to be [[LineStyleDefinition.ComponentType.StrokePattern]] if lcType is undefined */\r\n lcId: number;\r\n /** The component type, leave undefined if lcId is a [[LineStyleDefinition.ComponentType.StrokePattern]] */\r\n lcType?: ComponentType;\r\n /** Array of symbols */\r\n symbols: Symbols;\r\n }\r\n\r\n /** Raster component definition [[LineStyleDefinition.ComponentType.RasterImage]].\r\n * A raster component identifies a texture for a line style.\r\n */\r\n export interface RasterImageProps {\r\n /** Name for this raster image component */\r\n descr: string;\r\n /** Raster width */\r\n x: number;\r\n /** Raster height */\r\n y: number;\r\n /** True width flag */\r\n trueWidth?: number;\r\n /** Raster flags */\r\n flags?: number;\r\n /** The file property id of raster image */\r\n imageId?: number;\r\n }\r\n\r\n /** Identifies a component by file property id and type */\r\n export interface ComponentProps {\r\n /** The file property id of [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.StrokePoint]] component */\r\n id: number;\r\n /** The type of component for specified file property id */\r\n type: ComponentType;\r\n /** Offset distance for this component, default is 0 */\r\n offset?: number;\r\n }\r\n\r\n export type Components = ComponentProps[];\r\n\r\n /** Compound component definition [[LineStyleDefinition.ComponentType.Compound]].\r\n * A compound component is used to link stroke pattern and stroke point components to create a style that displays dashes, gaps, and symbols.\r\n */\r\n export interface CompoundProps {\r\n comps: Components;\r\n }\r\n\r\n /** Flags to describe a style or control style behavior */\r\n export enum StyleFlags {\r\n /** Use defaults */\r\n None = 0x00,\r\n /** Only snap to center line and not individual strokes and symbols of line style */\r\n NoSnap = 0x04,\r\n /** Style represents a continuous line with width (determined by looking at components if not set) */\r\n Continuous = 0x08,\r\n /** Style represents physical geometry and should be scaled as such */\r\n Physical = 0x80,\r\n }\r\n\r\n /** The line style definition element data */\r\n export interface StyleProps {\r\n /** The file property id for either a [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.Compound]] component */\r\n compId: number;\r\n /** The type of component for specified file property id */\r\n compType: ComponentType;\r\n /** Style behavior flags. Defaults to [[LineStyleDefinition.StyleFlags.NoSnap]] if left undefined */\r\n flags?: StyleFlags;\r\n /** Style scale, defaults to 1 */\r\n unitDef?: number;\r\n }\r\n\r\n /** Helper methods for creating and querying line styles */\r\n export class Utils {\r\n\r\n /** Create a file property for a new stroke pattern component. */\r\n public static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"LineCodeV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePattern };\r\n }\r\n\r\n /** Create a file property for a new point symbol component.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n */\r\n public static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined {\r\n // if part extents weren't supplied, set them up now.\r\n if (!props.baseX && !props.baseY && !props.baseZ && !props.sizeX && !props.sizeY && !props.sizeZ) {\r\n const geomPart = iModel.elements.getElement<GeometryPart>(props.geomPartId);\r\n if (!geomPart)\r\n return undefined;\r\n\r\n props.baseX = geomPart.bbox.low.x;\r\n props.baseY = geomPart.bbox.low.y;\r\n props.baseZ = geomPart.bbox.low.z;\r\n\r\n props.sizeX = geomPart.bbox.high.x;\r\n props.sizeY = geomPart.bbox.high.y;\r\n props.sizeZ = geomPart.bbox.high.z;\r\n }\r\n\r\n const fileProps: FilePropertyProps = { name: \"PointSymV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.PointSymbol };\r\n }\r\n\r\n /** Create a file property for a new stroke point component. */\r\n public static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"LinePointV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePoint };\r\n }\r\n\r\n /** Create a file property for a new compound component. */\r\n public static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps {\r\n const fileProps: FilePropertyProps = { name: \"CompoundV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.Compound };\r\n }\r\n\r\n /** Create a file property for a new raster image component. */\r\n public static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined {\r\n const rasterFileProps: FilePropertyProps = { name: \"RasterImageV1\", namespace: \"dgn_LStyle\" };\r\n rasterFileProps.id = iModel.queryNextAvailableFileProperty(rasterFileProps);\r\n iModel.saveFileProperty(rasterFileProps, undefined, image);\r\n props.imageId = rasterFileProps.id;\r\n const fileProps: FilePropertyProps = { name: \"RasterComponentV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n iModel.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.RasterImage };\r\n }\r\n\r\n /** Query for an existing line style with the supplied name. */\r\n public static queryStyle(imodel: IModelDb, scopeModelId: Id64String, name: string): Id64String | undefined {\r\n return imodel.elements.queryElementIdByCode(LineStyle.createCode(imodel, scopeModelId, name));\r\n }\r\n\r\n /** Insert a new line style with the supplied name.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n */\r\n public static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String {\r\n if (undefined === props.flags)\r\n props.flags = StyleFlags.NoSnap; // If flags weren't supplied, default to not snapping to stroke geometry.\r\n\r\n const lsProps: LineStyleProps = {\r\n classFullName: \"BisCore:LineStyle\",\r\n model: scopeModelId,\r\n code: LineStyle.createCode(imodel, scopeModelId, name),\r\n data: JSON.stringify(props),\r\n };\r\n\r\n return imodel.elements.insertElement(lsProps);\r\n }\r\n\r\n /** Get the name that can be use to query for an existing continuous line style. */\r\n public static getContinuousStyleName(width?: number): string {\r\n if (width === undefined)\r\n return \"Continuous\";\r\n\r\n return `Continuous-${width}`;\r\n }\r\n\r\n /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.\r\n * There are 2 ways to define a continuous line style:\r\n * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.\r\n * - Defined using [[LineStyleDefinition.ComponentType.Internal]] with component id 0 [[LinePixels.Solid]] which has special behavior of being affected by width overrides.\r\n * - Width is specified in the style.\r\n * - Defined using a single stroke component that is a long dash.\r\n *\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n */\r\n public static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number): Id64String {\r\n const name = this.getContinuousStyleName(width);\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n if (undefined !== lsId)\r\n return lsId;\r\n\r\n if (width === undefined)\r\n return this.createStyle(imodel, scopeModelId, name, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n\r\n const strokePatternData = this.createStrokePatternComponent(imodel, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });\r\n if (undefined === strokePatternData)\r\n throw new IModelError(IModelStatus.BadArg, \"Unable to insert stroke component\");\r\n\r\n return this.createStyle(imodel, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n }\r\n\r\n /** Get the name that can be use to query for an existing [[LinePixels]] line style.\r\n * @note Returns undefined for line pixels value that is not Code1 to Code7.\r\n */\r\n public static getLinePixelsStyleName(linePixels: LinePixels): string | undefined {\r\n const lineCode = getLinePixelsLineCode(linePixels);\r\n if (-1 === lineCode)\r\n return undefined;\r\n\r\n return `LinePixelsCodeNumber-${lineCode}`;\r\n }\r\n\r\n /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.\r\n * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.\r\n * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.\r\n * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.\r\n */\r\n public static getOrCreateLinePixelsStyle(imodel: IModelDb, scopeModelId: Id64String, linePixels: LinePixels): Id64String {\r\n const lineCode = getLinePixelsLineCode(linePixels);\r\n if (-1 === lineCode)\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid LinePixels\");\r\n\r\n const name = `LinePixelsCodeNumber-${lineCode}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n return (undefined === lsId ? this.createStyle(imodel, scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);\r\n }\r\n }\r\n}\r\n"]}
@@ -29,6 +29,7 @@ export * from "./domains/GenericSchema";
29
29
  export * from "./ECDb";
30
30
  export * from "./ECSchemaXmlContext";
31
31
  export * from "./ECSqlStatement";
32
+ export * from "./ECSqlSyncReader";
32
33
  export * from "./Element";
33
34
  export * from "./ElementAspect";
34
35
  export * from "./ElementGraphics";
@@ -1 +1 @@
1
- {"version":3,"file":"core-backend.d.ts","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAKA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAA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33,7 @@ export * from "./domains/GenericSchema";
33
33
  export * from "./ECDb";
34
34
  export * from "./ECSchemaXmlContext";
35
35
  export * from "./ECSqlStatement";
36
+ export * from "./ECSqlSyncReader";
36
37
  export * from "./Element";
37
38
  export * from "./ElementAspect";
38
39
  export * from "./ElementGraphics";
@@ -1 +1 @@
1
- {"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,C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EAAE,CAAC;IACjD,4DAA4D;IAC5D,MAAM,cAAc,GAAI,UAAkB,CAAC,uBAAuB,CAAC,CAAC,KAAK,CAAC;IAE1E,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,sEAAsE;QACtE,yDAAyD;QACzD,8CAA8C;QAC9C,wDAAwD,CACzD,CAAC;IAEF,+BAA+B;IAC/B,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC;IAC3D,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1D,8BAA8B;IAE9B,MAAM,KAAK,CAAC;AACd,CAAC;KAAM,CAAC;IACL,UAAkB,CAAC,uBAAuB,CAAC,GAAG;QAC7C,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,KAAK;KACzB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./annotations/ElementDrivesTextAnnotation\";\r\nexport * from \"./annotations/FrameGeometry\";\r\nexport * from \"./annotations/LeaderGeometry\";\r\nexport * from \"./annotations/TextAnnotationElement\";\r\nexport * from \"./annotations/TextAnnotationGeometry\";\r\nexport * from \"./annotations/TextBlockGeometry\";\r\nexport * from \"./annotations/TextBlockLayout\";\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./CatalogDb\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./FontFile\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./GeographicCRSServices\";\r\nexport * from \"./ImageSourceConversion\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelDbFonts\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./LockControl\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SheetIndex\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./workspace/WorkspaceEditor\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\n\r\nexport * from \"./internal/cross-package\";\r\n\r\nconst globalSymbolCoreBackend = Symbol.for(\"itwin.core.backend.globals\");\r\nif ((globalThis as any)[globalSymbolCoreBackend]) {\r\n // Get the stack trace from when the module was first loaded\r\n const firstLoadStack = (globalThis as any)[globalSymbolCoreBackend].stack;\r\n\r\n const error = new Error(\r\n \"Multiple @itwin/core-backend imports detected! This may happen if:\\n\" +\r\n \"- You have multiple versions of the package installed\\n\" +\r\n \"- Your bundling configuration is incorrect\\n\" +\r\n \"- You're importing from both ESM and CommonJS versions\"\r\n );\r\n\r\n /* eslint-disable no-console */\r\n console.error(\"Duplicate @itwin/core-backend import:\", error);\r\n console.error(\"First import occurred at:\", firstLoadStack);\r\n console.error(\"Current import occurred at:\", error.stack);\r\n /* eslint-enable no-console */\r\n\r\n throw error;\r\n} else {\r\n (globalThis as any)[globalSymbolCoreBackend] = {\r\n stack: new Error().stack,\r\n };\r\n}\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementGeometry\r\n * Classes for defining the symbology and geometry of geometric elements\r\n */\r\n\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ExportGraphics\r\n * APIs for producing low-level graphics primitives from element geometry.\r\n */\r\n\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n\r\n/**\r\n * @docs-group-description Images\r\n * APIs for encoding and decoding images\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Portability\r\n */\r\n\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n"]}
1
+ {"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc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;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./annotations/ElementDrivesTextAnnotation\";\r\nexport * from \"./annotations/FrameGeometry\";\r\nexport * from \"./annotations/LeaderGeometry\";\r\nexport * from \"./annotations/TextAnnotationElement\";\r\nexport * from \"./annotations/TextAnnotationGeometry\";\r\nexport * from \"./annotations/TextBlockGeometry\";\r\nexport * from \"./annotations/TextBlockLayout\";\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./CatalogDb\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./ECSqlSyncReader\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./FontFile\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./GeographicCRSServices\";\r\nexport * from \"./ImageSourceConversion\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelDbFonts\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./LockControl\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SheetIndex\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./workspace/WorkspaceEditor\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\n\r\nexport * from \"./internal/cross-package\";\r\n\r\nconst globalSymbolCoreBackend = Symbol.for(\"itwin.core.backend.globals\");\r\nif ((globalThis as any)[globalSymbolCoreBackend]) {\r\n // Get the stack trace from when the module was first loaded\r\n const firstLoadStack = (globalThis as any)[globalSymbolCoreBackend].stack;\r\n\r\n const error = new Error(\r\n \"Multiple @itwin/core-backend imports detected! This may happen if:\\n\" +\r\n \"- You have multiple versions of the package installed\\n\" +\r\n \"- Your bundling configuration is incorrect\\n\" +\r\n \"- You're importing from both ESM and CommonJS versions\"\r\n );\r\n\r\n /* eslint-disable no-console */\r\n console.error(\"Duplicate @itwin/core-backend import:\", error);\r\n console.error(\"First import occurred at:\", firstLoadStack);\r\n console.error(\"Current import occurred at:\", error.stack);\r\n /* eslint-enable no-console */\r\n\r\n throw error;\r\n} else {\r\n (globalThis as any)[globalSymbolCoreBackend] = {\r\n stack: new Error().stack,\r\n };\r\n}\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementGeometry\r\n * Classes for defining the symbology and geometry of geometric elements\r\n */\r\n\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ExportGraphics\r\n * APIs for producing low-level graphics primitives from element geometry.\r\n */\r\n\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n\r\n/**\r\n * @docs-group-description Images\r\n * APIs for encoding and decoding images\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Portability\r\n */\r\n\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceImpl.d.ts","sourceRoot":"","sources":["../../../../src/internal/workspace/WorkspaceImpl.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EAAoB,iBAAiB,EAA+C,MAAM,oBAAoB,CAAC;AAMtH,OAAO,EAAe,QAAQ,EAAgE,MAAM,0BAA0B,CAAC;AAE/H,OAAO,EACsB,SAAS,EAAE,kBAAkB,EAAE,oBAAoB,EAA2B,WAAW,EAC/F,oBAAoB,EAA0F,gBAAgB,EAC1F,aAAa,EACvE,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAqH,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAUrL,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AA2qBpD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,GAAG,WAAW,CAExG;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,cAAc,CAE3F;AAED,wBAAgB,wBAAwB,IAAI,eAAe,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,oBAAoB,QAGpE;AAED,eAAO,MAAM,yBAAyB,EAAE,iBAAgE,CAAC;AAOzG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAEvG;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,kDAAkD;IAClD,KAAK,IAAI,IAAI,CAAC;CACf"}
1
+ {"version":3,"file":"WorkspaceImpl.d.ts","sourceRoot":"","sources":["../../../../src/internal/workspace/WorkspaceImpl.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EAAoB,iBAAiB,EAA+C,MAAM,oBAAoB,CAAC;AAMtH,OAAO,EAAe,QAAQ,EAAgE,MAAM,0BAA0B,CAAC;AAE/H,OAAO,EACsB,SAAS,EAAE,kBAAkB,EAAE,oBAAoB,EAA2B,WAAW,EAC/F,oBAAoB,EAA0F,gBAAgB,EAC1F,aAAa,EACvE,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAqH,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAUrL,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AAqrBpD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,GAAG,WAAW,CAExG;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,cAAc,CAE3F;AAED,wBAAgB,wBAAwB,IAAI,eAAe,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,oBAAoB,QAGpE;AAED,eAAO,MAAM,yBAAyB,EAAE,iBAAgE,CAAC;AAOzG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAEvG;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,kDAAkD;IAClD,KAAK,IAAI,IAAI,CAAC;CACf"}
@@ -298,7 +298,11 @@ class WorkspaceImpl {
298
298
  return this.findContainer(props.containerId) ?? new WorkspaceContainerImpl(this, props);
299
299
  }
300
300
  async getContainerAsync(props) {
301
- const accessToken = props.accessToken ?? ((props.baseUri === "") || props.isPublic) ? "" : await CloudSqlite.requestToken({ ...props, accessLevel: "read" });
301
+ if (props.accessToken)
302
+ return this.getContainer({ ...props, accessToken: props.accessToken });
303
+ const accessToken = (props.baseUri === "" || props.isPublic)
304
+ ? ""
305
+ : await CloudSqlite.requestToken({ ...props, accessLevel: "read" });
302
306
  return this.getContainer({ ...props, accessToken });
303
307
  }
304
308
  async getWorkspaceDb(props) {
@@ -422,7 +426,11 @@ class EditorImpl {
422
426
  return this.workspace.findContainer(props.containerId) ?? new EditorContainerImpl(this.workspace, props);
423
427
  }
424
428
  async getContainerAsync(props) {
425
- const accessToken = props.accessToken ?? (props.baseUri === "") ? "" : await CloudSqlite.requestToken({ ...props, accessLevel: "write" });
429
+ if (props.accessToken)
430
+ return this.getContainer({ ...props, accessToken: props.accessToken });
431
+ const accessToken = (props.baseUri === "")
432
+ ? ""
433
+ : await CloudSqlite.requestToken({ ...props, accessLevel: "write" });
426
434
  return this.getContainer({ ...props, accessToken });
427
435
  }
428
436
  close() {