diff --git a/common/api/core-common.api.md b/common/api/core-common.api.md index 9eecc43b2541..65140704739f 100644 --- a/common/api/core-common.api.md +++ b/common/api/core-common.api.md @@ -468,10 +468,10 @@ export class BackendError extends IModelError { constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData); } -// @public @deprecated (undocumented) +// @internal @deprecated (undocumented) export type BackendReadable = Readable; -// @public @deprecated (undocumented) +// @internal @deprecated (undocumented) export type BackendWritable = Writable; // @public @@ -1290,9 +1290,6 @@ export class CodeSpec { iModel: IModel; // (undocumented) get isExternal(): boolean; - // @deprecated - get isManagedWithIModel(): boolean; - set isManagedWithIModel(value: boolean); get isValid(): boolean; name: string; // @internal @@ -3344,12 +3341,6 @@ export class FeatureOverrides implements FeatureAppearanceSource { readonly neverDrawnAnimationNodes: Set; override(args: OverrideFeatureAppearanceArgs): void; overrideAnimationNode(id: number, app: FeatureAppearance): void; - // @deprecated - overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void; - // @deprecated - overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void; - // @deprecated - overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void; protected _patterns: boolean; setAlwaysDrawn(id: Id64String): void; setAlwaysDrawnSet(ids: Iterable, exclusive: boolean, ignoreSubCategory?: boolean): void; @@ -4652,8 +4643,6 @@ export interface HydrateViewStateRequestProps { acsId?: string; // (undocumented) baseModelId?: Id64String; - // @deprecated (undocumented) - notLoadedCategoryIds?: CompressedId64Set; // (undocumented) notLoadedModelSelectorStateModels?: CompressedId64Set; // (undocumented) @@ -4670,8 +4659,6 @@ export interface HydrateViewStateResponseProps { acsElementProps?: ElementProps; // (undocumented) baseModelProps?: ModelProps; - // @deprecated (undocumented) - categoryIdsResult?: SubCategoryResultRow[]; // (undocumented) modelSelectorStateModels?: ModelProps[]; // (undocumented) @@ -5678,8 +5665,6 @@ export interface Localization { getLanguageList(): readonly string[]; getLocalizedKeys(inputString: string): string; getLocalizedString(key: string | string[], options?: TranslationOptions): string; - // @deprecated - getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TranslationOptions): string; // @internal (undocumented) getNamespacePromise(name: string): Promise | undefined; initialize(namespaces: string[]): Promise; @@ -7664,7 +7649,7 @@ export abstract class RenderMaterial { // @public (undocumented) export namespace RenderMaterial { - // @deprecated (undocumented) + // @internal export class Params { constructor(key?: string); get alpha(): number | undefined; @@ -8093,7 +8078,7 @@ export abstract class RenderTexture implements Disposable { // @public (undocumented) export namespace RenderTexture { - // @deprecated + // @internal export class Params { constructor(key?: string, type?: RenderTexture.Type, isOwned?: boolean); // (undocumented) @@ -9635,9 +9620,6 @@ export interface TerrainProps { providerName?: string; } -// @public @deprecated -export type TerrainProviderName = string; - // @public export class TerrainSettings { // @deprecated diff --git a/common/api/summary/core-common.exports.csv b/common/api/summary/core-common.exports.csv index 4fa92b7dbb7d..831be8793539 100644 --- a/common/api/summary/core-common.exports.csv +++ b/common/api/summary/core-common.exports.csv @@ -31,9 +31,9 @@ internal;class;B3dmHeader internal;type;BackendBuffer deprecated;type;BackendBuffer public;class;BackendError -public;type;BackendReadable +internal;type;BackendReadable deprecated;type;BackendReadable -public;type;BackendWritable +internal;type;BackendWritable deprecated;type;BackendWritable public;enum;BackgroundFill public;interface;BackgroundMapProps @@ -676,6 +676,7 @@ public;type;RemoveFunction public;interface;RenderFeatureTable public;class;RenderMaterial public;namespace;RenderMaterial +internal;class;Params public;interface;RenderMaterialAssetMapsProps public;interface;RenderMaterialAssetProps public;interface;RenderMaterialProps @@ -684,6 +685,7 @@ public;namespace;RenderSchedule internal;class;Interval public;class;RenderTexture public;namespace;RenderTexture +internal;class;Params public;interface;RenderTimelineLoadProps public;interface;RenderTimelineProps public;interface;RepositoryLinkProps @@ -829,8 +831,6 @@ beta;interface;SynchronizationConfigLinkProps public;enum;SyncMode public;enum;TerrainHeightOriginMode public;interface;TerrainProps -public;type;TerrainProviderName -deprecated;type;TerrainProviderName public;class;TerrainSettings internal;class;TestRpcManager beta;class;TextAnnotation diff --git a/common/changes/@itwin/core-backend/mike-remove-deprecated-corecommon_2025-01-31-16-39.json b/common/changes/@itwin/core-backend/mike-remove-deprecated-corecommon_2025-01-31-16-39.json new file mode 100644 index 000000000000..5f1430466d09 --- /dev/null +++ b/common/changes/@itwin/core-backend/mike-remove-deprecated-corecommon_2025-01-31-16-39.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-backend", + "comment": "Remove 3.x Deprecated APIs", + "type": "none" + } + ], + "packageName": "@itwin/core-backend" +} \ No newline at end of file diff --git a/common/changes/@itwin/core-common/mike-remove-deprecated-corecommon_2025-01-31-16-39.json b/common/changes/@itwin/core-common/mike-remove-deprecated-corecommon_2025-01-31-16-39.json new file mode 100644 index 000000000000..ac39a9224dac --- /dev/null +++ b/common/changes/@itwin/core-common/mike-remove-deprecated-corecommon_2025-01-31-16-39.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-common", + "comment": "Remove 3.x Deprecated APIs", + "type": "none" + } + ], + "packageName": "@itwin/core-common" +} \ No newline at end of file diff --git a/common/changes/@itwin/core-extension/mike-remove-deprecated-corecommon_2025-01-31-16-39.json b/common/changes/@itwin/core-extension/mike-remove-deprecated-corecommon_2025-01-31-16-39.json new file mode 100644 index 000000000000..19751555dc14 --- /dev/null +++ b/common/changes/@itwin/core-extension/mike-remove-deprecated-corecommon_2025-01-31-16-39.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-extension", + "comment": "Remove 3.x Deprecated APIs", + "type": "none" + } + ], + "packageName": "@itwin/core-extension" +} \ No newline at end of file diff --git a/core/backend/src/ViewStateHydrator.ts b/core/backend/src/ViewStateHydrator.ts index a1411fb779b7..b89b2af0d613 100644 --- a/core/backend/src/ViewStateHydrator.ts +++ b/core/backend/src/ViewStateHydrator.ts @@ -3,7 +3,7 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { BentleyError, CompressedId64Set, Id64String, Logger } from "@itwin/core-bentley"; -import { HydrateViewStateRequestProps, HydrateViewStateResponseProps, ModelProps, SubCategoryResultRow, ViewAttachmentProps, ViewStateLoadProps } from "@itwin/core-common"; +import { HydrateViewStateRequestProps, HydrateViewStateResponseProps, ModelProps, ViewAttachmentProps, ViewStateLoadProps } from "@itwin/core-common"; import { BackendLoggerCategory } from "./BackendLoggerCategory"; import { IModelDb } from "./IModelDb"; @@ -21,11 +21,6 @@ export class ViewStateHydrator { promises.push(this.handleAcsId(response, options.acsId)); if (options.sheetViewAttachmentIds) promises.push(this.handleSheetViewAttachmentIds(response, options.sheetViewAttachmentIds, options.viewStateLoadProps)); - // eslint-disable-next-line @typescript-eslint/no-deprecated - if (options.notLoadedCategoryIds) { - // eslint-disable-next-line @typescript-eslint/no-deprecated - promises.push(this.handleCategoryIds(response, options.notLoadedCategoryIds)); - } if (options.spatialViewId) promises.push(this.handleSpatialViewId(response, options.spatialViewId, options.viewStateLoadProps)); if (options.notLoadedModelSelectorStateModels) @@ -36,14 +31,6 @@ export class ViewStateHydrator { return response; } - private async handleCategoryIds(response: HydrateViewStateResponseProps, categoryIds: CompressedId64Set) { - const decompressedIds = CompressedId64Set.decompressArray(categoryIds); - const results: SubCategoryResultRow[] = await this._imodel.querySubCategories(decompressedIds); - - // eslint-disable-next-line @typescript-eslint/no-deprecated - response.categoryIdsResult = results; - } - private async handleBaseModelId(response: HydrateViewStateResponseProps, baseModelId: Id64String) { let modelProps; try { diff --git a/core/common/src/BackendTypes.ts b/core/common/src/BackendTypes.ts index 57af1b031c11..ef9fd1866c6d 100644 --- a/core/common/src/BackendTypes.ts +++ b/core/common/src/BackendTypes.ts @@ -16,10 +16,10 @@ Do not add any new types to this file. All types here will be removed in 4.0 */ -/** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */ +/** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */ export type BackendReadable = Readable; -/** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */ +/** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */ export type BackendWritable = Writable; /** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */ diff --git a/core/common/src/Code.ts b/core/common/src/Code.ts index 0a4755b7c15d..d14cd23aa0dd 100644 --- a/core/common/src/Code.ts +++ b/core/common/src/Code.ts @@ -333,17 +333,4 @@ export class CodeSpec { else this.properties.scopeSpec.fGuidRequired = undefined; } - - /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service. - * @deprecated in 3.6 Use scopeReq instead. - */ - public get isManagedWithIModel(): boolean { - return this.properties.spec?.isManagedWithDgnDb ?? true; - } - public set isManagedWithIModel(value: boolean) { - if (!this.properties.spec) - this.properties.spec = {}; - - this.properties.spec.isManagedWithDgnDb = value; - } } diff --git a/core/common/src/FeatureSymbology.ts b/core/common/src/FeatureSymbology.ts index ba14899d4bdc..09da7d9cbfe5 100644 --- a/core/common/src/FeatureSymbology.ts +++ b/core/common/src/FeatureSymbology.ts @@ -817,42 +817,6 @@ export class FeatureOverrides implements FeatureAppearanceSource { map.set(idLo, idHi, app); } - /** Specify overrides for all elements within the specified model. - * @param id The Id of the model. - * @param app The symbology overrides. - * @param replaceExisting Specifies whether to replace a pre-existing override for the same model. - * @note These overrides take priority over all other overrides. - * @note If [[defaultOverrides]] are defined, they will not apply to any element within this model, even if the supplied appearance overrides nothing. - * @deprecated in 3.x. Use [[FeatureOverrides.override]]. - */ - public overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void { - this.override({ modelId: id, appearance: app, onConflict: replaceExisting ? "replace" : "skip" }); - } - - /** Specify overrides for all geometry belonging to the specified [SubCategory]($backend). - * @param id The Id of the subcategory. - * @param app The symbology overrides. - * @param replaceExisting Specifies whether to replace a pre-existing override for the same subcategory. - * @note These overrides have lower priority than element and model overrides. - * @note If [[defaultOverrides]] are defined, they will not apply to any geometry within this subcategory, even if the supplied appearance overrides nothing. - * @deprecated in 3.x. Use [[FeatureOverrides.override]]. - */ - public overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void { - this.override({ subCategoryId: id, appearance: app, onConflict: replaceExisting ? "replace" : "skip" }); - } - - /** Specify overrides for all geometry originating from the specified element. - * @param id The Id of the element. - * @param app The symbology overrides. - * @param replaceExisting Specifies whether to replace a pre-existing override for the same element. - * @note These overrides take precedence over subcategory overrides, but not over model overrides. - * @note If [[defaultOverrides]] are defined, they will not apply to this element, even if the supplied appearance overrides nothing. - * @deprecated in 3.x. Use [[FeatureOverrides.override]]. - */ - public overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void { - this.override({ elementId: id, appearance: app, onConflict: replaceExisting ? "replace" : "skip" }); - } - /** Specify overrides for all geometry originating from the specified animation node. * @param id The Id of the animation node. * @param app The symbology overrides. diff --git a/core/common/src/Localization.ts b/core/common/src/Localization.ts index 1901a54e2737..0495f1fd59f9 100644 --- a/core/common/src/Localization.ts +++ b/core/common/src/Localization.ts @@ -60,15 +60,6 @@ export interface Localization { * @throws Error if no keys resolve to a string. */ getLocalizedString(key: string | string[], options?: TranslationOptions): string; - /** Similar to `getLocalizedString` but the namespace is a separate param and the key does not include the namespace. - * @param namespace - the namespace that identifies the particular localization file that contains the property. - * @param key - the key that matches a property in the JSON localization file. - * @returns The string corresponding to the first key that resolves. - * @throws Error if no keys resolve to a string. - * @deprecated in 3.x. Use `getLocalizedString` instead; providing either a key with a namespace `:` or - * including `{ ns: }` in the options. - */ - getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TranslationOptions): string; /** get the English string for a key. */ getEnglishString(namespace: string, key: string | string[], options?: TranslationOptions): string; /** Replace all instances of `%{key}` within a string with the translations of those keys. diff --git a/core/common/src/RenderMaterial.ts b/core/common/src/RenderMaterial.ts index 09106d60c03e..a85d958977e0 100644 --- a/core/common/src/RenderMaterial.ts +++ b/core/common/src/RenderMaterial.ts @@ -43,7 +43,9 @@ export namespace RenderMaterial { return Math.max(0.0, Math.min(1.0, value)); } - /** @deprecated in 3.x. Use [CreateRenderMaterialArgs]($frontend). */ + /** Params for use in old CreateMaterial functions. Use [CreateRenderMaterialArgs]($frontend) instead. + * @internal + */ export class Params { /** If the material originates from a Material element in the [[IModel]], the Id of that element. */ public key?: string; @@ -75,7 +77,6 @@ export namespace RenderMaterial { public constructor(key?: string) { this.key = key; } /** Obtain an immutable instance of a RenderMaterial with all default properties. */ - // eslint-disable-next-line @typescript-eslint/no-deprecated public static readonly defaults = new Params(); /** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied; @@ -87,9 +88,7 @@ export namespace RenderMaterial { } /** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */ - // eslint-disable-next-line @typescript-eslint/no-deprecated public static fromColors(key?: string, diffuseColor?: ColorDef, specularColor?: ColorDef, emissiveColor?: ColorDef, reflectColor?: ColorDef, textureMap?: TextureMapping): Params { - // eslint-disable-next-line @typescript-eslint/no-deprecated const materialParams = new Params(); materialParams.key = key; materialParams.diffuseColor = diffuseColor; @@ -102,5 +101,5 @@ export namespace RenderMaterial { } } -// eslint-disable-next-line @typescript-eslint/no-deprecated + Object.freeze(RenderMaterial.Params.defaults); diff --git a/core/common/src/RenderTexture.ts b/core/common/src/RenderTexture.ts index 0b4cca21d04d..8c5c2146998a 100644 --- a/core/common/src/RenderTexture.ts +++ b/core/common/src/RenderTexture.ts @@ -75,8 +75,8 @@ export namespace RenderTexture { } /** Parameters used to construct a [[RenderTexture]]. - * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs. - * @public + * Use RenderSystem.createTexture and CreateTextureArgs. + * @internal */ export class Params { /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element. diff --git a/core/common/src/TerrainSettings.ts b/core/common/src/TerrainSettings.ts index e63f307cc8bb..0f212efe36ae 100644 --- a/core/common/src/TerrainSettings.ts +++ b/core/common/src/TerrainSettings.ts @@ -8,14 +8,6 @@ import { BackgroundMapProps } from "./BackgroundMapSettings"; -/** Identifies a [TerrainProvider]($frontend). - * @see [[TerrainSettings.providerName]] and [[TerrainProps.providerName]]. - * @public - * @extensions - * @deprecated in 3.x. Use string instead. - */ -export type TerrainProviderName = string; - /** Ids of [Cesium ION assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data. * These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain". * You may alternatively use the Id of any ION asset to which you have access. diff --git a/core/common/src/ViewProps.ts b/core/common/src/ViewProps.ts index e354fa34e20a..96fc2ac3b6b4 100644 --- a/core/common/src/ViewProps.ts +++ b/core/common/src/ViewProps.ts @@ -71,8 +71,6 @@ export interface SubCategoryResultRow { export interface HydrateViewStateRequestProps { acsId?: string; notLoadedModelSelectorStateModels?: CompressedId64Set; - /** @deprecated in 3.x. If loading categoryIds is necessary, see [IModelConnection.SubCategoriesCache.load]($frontend)*/ - notLoadedCategoryIds?: CompressedId64Set; sheetViewAttachmentIds?: CompressedId64Set; viewStateLoadProps?: ViewStateLoadProps; baseModelId?: Id64String; @@ -90,8 +88,6 @@ export interface HydrateViewStateResponseProps { sheetViewViews?: (ViewStateProps | undefined)[]; baseModelProps?: ModelProps; spatialViewProps?: ViewStateProps; - /** @deprecated in 3.x. If loading categoryIds is necessary, see [IModelConnection.SubCategoriesCache.load]($frontend)*/ - categoryIdsResult?: SubCategoryResultRow[]; } /** Returned from [IModelDb.Views.getViewStateData]($backend). diff --git a/core/common/src/test/FeatureSymbology.test.ts b/core/common/src/test/FeatureSymbology.test.ts index b1e29f7155de..51ee6f6450c9 100644 --- a/core/common/src/test/FeatureSymbology.test.ts +++ b/core/common/src/test/FeatureSymbology.test.ts @@ -147,72 +147,72 @@ describe("FeatureOverrides", () => { assert.isTrue(overrides.isSubCategoryIdVisible(subCategoryId)); }); - it("overrideModel works as expected", () => { + it("override Model works as expected", () => { const overrides = new Overrides(); - const id = Id64.fromString("0x111"); + const modelId = Id64.fromString("0x111"); const props1 = { rgb: new RgbColor(100, 100, 100), weight: 1, transparency: 100 / 255, linePixels: LinePixels.Solid, ignoresMaterial: true } as FeatureAppearanceProps; const props2 = { ...props1, transparency: 200 / 255 } as FeatureAppearanceProps; const modelApp1 = FeatureAppearance.fromJSON(props1); const modelApp2 = FeatureAppearance.fromJSON(props2); - overrides.overrideModel(id, modelApp1); // eslint-disable-line @typescript-eslint/no-deprecated - assert.exists(overrides.getModelOverridesById(id)); + overrides.override({modelId, appearance: modelApp1}); + assert.exists(overrides.getModelOverridesById(modelId)); - overrides.overrideModel(id, modelApp2); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getModelOverridesById(id)!.equals(modelApp2), "overrideModel will override prexisting model associated with given id if replaceExisting is not set to false explicitly"); + overrides.override({modelId, appearance: modelApp2}); + assert.isTrue(overrides.getModelOverridesById(modelId)!.equals(modelApp2), "overrideModel will override prexisting model associated with given id if replaceExisting is not set to false explicitly"); - overrides.overrideModel(id, modelApp1, false); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getModelOverridesById(id)!.equals(modelApp2), "overrides will not replace model if replace existing is set to false"); + overrides.override({modelId, appearance: modelApp1, onConflict: "skip"}); + assert.isTrue(overrides.getModelOverridesById(modelId)!.equals(modelApp2), "overrides will not replace model if replace existing is set to false"); - overrides.overrideModel(id, modelApp1); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getModelOverridesById(id)!.equals(modelApp1), "overrides will replace model if replace existing isn't set to false (test 2)"); + overrides.override({modelId, appearance: modelApp1}); + assert.isTrue(overrides.getModelOverridesById(modelId)!.equals(modelApp1), "overrides will replace model if replace existing isn't set to false (test 2)"); }); - it("overrideSubCategory works as expected", () => { + it("override SubCategory works as expected", () => { const overrides = new Overrides(); - const id = Id64.fromString("0x111"); + const subCategoryId = Id64.fromString("0x111"); const props1 = { rgb: new RgbColor(100, 100, 100), weight: 1, transparency: 100 / 255, linePixels: LinePixels.Solid, ignoresMaterial: true } as FeatureAppearanceProps; const props2 = { ...props1, transparency: 200 / 255 } as FeatureAppearanceProps; const subCatApp1 = FeatureAppearance.fromJSON(props1); const subCatApp2 = FeatureAppearance.fromJSON(props2); // Even though the subcategory is invisible, it's possible a model will override it to be visible. - // So overrideSubCategory() will record the appearance override anyway. - expect(overrides.getSubCategoryOverridesById(id)).to.be.undefined; - overrides.overrideSubCategory(id, subCatApp1); // eslint-disable-line @typescript-eslint/no-deprecated - expect(overrides.getSubCategoryOverridesById(id)).not.to.be.undefined; + // So override() will record the appearance override anyway. + expect(overrides.getSubCategoryOverridesById(subCategoryId)).to.be.undefined; + overrides.override({subCategoryId, appearance: subCatApp1}); + expect(overrides.getSubCategoryOverridesById(subCategoryId)).not.to.be.undefined; - overrides.setVisibleSubCategory(id); - overrides.overrideSubCategory(id, subCatApp2); // eslint-disable-line @typescript-eslint/no-deprecated - assert.exists(overrides.getSubCategoryOverridesById(id), "if subCategoryId is in subCategoryVisible set, then subCategoryApp set"); + overrides.setVisibleSubCategory(subCategoryId); + overrides.override({subCategoryId, appearance: subCatApp2}); + assert.exists(overrides.getSubCategoryOverridesById(subCategoryId), "if subCategoryId is in subCategoryVisible set, then subCategoryApp set"); - overrides.overrideSubCategory(id, subCatApp1, false); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getSubCategoryOverridesById(id)!.equals(subCatApp2), "overrides will not replace subCatApp if replace existing is set to false"); + overrides.override({subCategoryId, appearance: subCatApp1, onConflict: "skip"}); + assert.isTrue(overrides.getSubCategoryOverridesById(subCategoryId)!.equals(subCatApp2), "overrides will not replace subCatApp if replace existing is set to false"); - overrides.overrideSubCategory(id, subCatApp1); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getSubCategoryOverridesById(id)!.equals(subCatApp1), "overrides will replace subCatApp if replace existing isn't set to false"); + overrides.override({subCategoryId, appearance: subCatApp1}); + assert.isTrue(overrides.getSubCategoryOverridesById(subCategoryId)!.equals(subCatApp1), "overrides will replace subCatApp if replace existing isn't set to false"); }); - it("overrideElement works as expected", () => { + it("override Element works as expected", () => { let overrides = new Overrides(); - const id = Id64.fromString("0x111"); + const elementId = Id64.fromString("0x111"); const props1 = { rgb: new RgbColor(100, 100, 100), weight: 1, transparency: 100 / 255, linePixels: LinePixels.Solid, ignoresMaterial: true } as FeatureAppearanceProps; const props2 = { ...props1, transparency: 200 / 255 } as FeatureAppearanceProps; const elemApp1 = FeatureAppearance.fromJSON(props1); const elemApp2 = FeatureAppearance.fromJSON(props2); - overrides.setNeverDrawn(id); - overrides.overrideElement(id, elemApp1); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isUndefined(overrides.getElementOverridesById(id), "if elementId is in never drawn set, then nothing is set"); + overrides.setNeverDrawn(elementId); + overrides.override({elementId, appearance: elemApp1}); + assert.isUndefined(overrides.getElementOverridesById(elementId), "if elementId is in never drawn set, then nothing is set"); overrides = new Overrides(); - overrides.overrideElement(id, elemApp1); // eslint-disable-line @typescript-eslint/no-deprecated - assert.exists(overrides.getElementOverridesById(id), "if elementId is not in never drawn set, then elemApp is set"); + overrides.override({elementId, appearance: elemApp1}); + assert.exists(overrides.getElementOverridesById(elementId), "if elementId is not in never drawn set, then elemApp is set"); - overrides.overrideElement(id, elemApp2, false); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getElementOverridesById(id)!.equals(elemApp1), "overrides will not replace elemApp if replace existing is set to false"); + overrides.override({elementId, appearance: elemApp2, onConflict: "skip"}); + assert.isTrue(overrides.getElementOverridesById(elementId)!.equals(elemApp1), "overrides will not replace elemApp if replace existing is set to false"); - overrides.overrideElement(id, elemApp2); // eslint-disable-line @typescript-eslint/no-deprecated - assert.isTrue(overrides.getElementOverridesById(id)!.equals(elemApp2), "overrides will replace elemApp if replace existing isn't set to false"); + overrides.override({elementId, appearance: elemApp2}); + assert.isTrue(overrides.getElementOverridesById(elementId)!.equals(elemApp2), "overrides will replace elemApp if replace existing isn't set to false"); }); it("setDefaultOverrides works as expected", () => { @@ -243,12 +243,12 @@ describe("FeatureOverrides", () => { const defApp = FeatureAppearance.fromRgb(ColorDef.red); ovrs.setDefaultOverrides(defApp); - ovrs.overrideElement(el1, app); // eslint-disable-line @typescript-eslint/no-deprecated - ovrs.overrideModel(mod1, app); // eslint-disable-line @typescript-eslint/no-deprecated - ovrs.overrideSubCategory(cat1, app); // eslint-disable-line @typescript-eslint/no-deprecated - ovrs.overrideElement(el2, noApp); // eslint-disable-line @typescript-eslint/no-deprecated - ovrs.overrideModel(mod2, noApp); // eslint-disable-line @typescript-eslint/no-deprecated - ovrs.overrideSubCategory(cat2, noApp); // eslint-disable-line @typescript-eslint/no-deprecated + ovrs.override({elementId: el1, appearance: app}); + ovrs.override({modelId: mod1, appearance: app}); + ovrs.override({subCategoryId: cat1, appearance: app}); + ovrs.override({elementId: el2, appearance: noApp}); + ovrs.override({modelId: mod2, appearance: noApp}); + ovrs.override({subCategoryId: cat2, appearance: noApp}); const expectAppearance = (elem: Id64String, model: Id64String, subcat: Id64String, expectedAppearance: FeatureAppearance) => { const feature = new Feature(elem, subcat, GeometryClass.Primary); @@ -360,18 +360,18 @@ describe("FeatureOverrides", () => { expectAppearance("0xa", 2, halfTransp); expectAppearance("0xa", 3, halfTranspWeight5); - ovrs.overrideElement("0xc", FeatureAppearance.defaults); // eslint-disable-line @typescript-eslint/no-deprecated + ovrs.override({elementId: "0xc", appearance: FeatureAppearance.defaults}); expectAppearance("0xc", 1, red); expectAppearance("0xc", 2, halfTransp); expectAppearance("0xc", 3, halfTranspWeight5); - ovrs.overrideElement("0xa", blue); // eslint-disable-line @typescript-eslint/no-deprecated + ovrs.override({elementId: "0xa", appearance: blue}); expectAppearance("0xa", 1, blue); expectAppearance("0xa", 2, merge(blue, { transparency: 0.5 })); expectAppearance("0xa", 3, merge(blue, { transparency: 0.5, weight: 5 })); const greenWeight3 = FeatureAppearance.fromJSON({ rgb: { r: 0, g: 255, b: 0 }, weight: 3 }); - ovrs.overrideElement("0xb", greenWeight3); // eslint-disable-line @typescript-eslint/no-deprecated + ovrs.override({elementId: "0xb", appearance: greenWeight3}); expectAppearance("0xb", 1, greenWeight3); expectAppearance("0xb", 2, merge(greenWeight3, { transparency: 0.5 })); expectAppearance("0xb", 3, merge(greenWeight3, { transparency: 0.5 })); diff --git a/core/extension/index.d.ts b/core/extension/index.d.ts index 6224052c16a3..fbe59084ce5a 100644 --- a/core/extension/index.d.ts +++ b/core/extension/index.d.ts @@ -594,7 +594,6 @@ export type { SubCategoryProps, SubjectProps, TerrainProps, - TerrainProviderName, TextAnnotation2dProps, TextAnnotation3dProps, TextStringPrimitive, diff --git a/docs/changehistory/NextVersion.md b/docs/changehistory/NextVersion.md index e40c40b3f9a8..8bacbd9ed80c 100644 --- a/docs/changehistory/NextVersion.md +++ b/docs/changehistory/NextVersion.md @@ -27,11 +27,12 @@ Table of contents: - [@itwin/appui-abstract](#itwinappui-abstract) - [@itwin/core-backend](#itwincore-backend-1) - [@itwin/core-bentley](#itwincore-bentley-1) + - [@itwin/core-common](#itwincore-common-1) - [@itwin/core-electron](#itwincore-electron) - [@itwin/core-frontend](#itwincore-frontend-1) - [@itwin/core-geometry](#itwincore-geometry) - [API removals](#api-removals) - - [@itwin/core-common](#itwincore-common-1) + - [@itwin/core-common](#itwincore-common-2) - [Packages dropped](#packages-dropped) - [Change to pullMerge](#change-to-pullmerge) - [No pending/local changes](#no-pendinglocal-changes) @@ -223,6 +224,19 @@ All three `nativeDb` fields and `IModelHost.platform` have always been `@interna | `ByteStream.nextUint24` | `ByteStream.readUint32` | | `TransientIdSequence.next` | `TransientIdSequence.getNext` | +#### @itwin/core-common + +| Removed | Replacement | +| ---------------------------------------------- | ---------------------------------------------------- | +| `CodeSpec.isManagedWithIModel` | `CodeSpec.scopeReq` | +| `FeatureOverrides.overrideModel` | `FeatureOverrides.override` | +| `FeatureOverrides.overrideSubCategory` | `FeatureOverrides.override` | +| `FeatureOverrides.overrideElement` | `FeatureOverrides.override` | +| `Localization.getLocalizedStringWithNamespace` | `Localization.getLocalizedString` | +| `TerrainProviderName` | `string` | +| `RenderMaterial.Params` | `CreateRenderMaterialArgs` | +| `RenderTexture.Params` | `RenderSystem.createTexture` and `CreateTextureArgs` | + #### @itwin/core-electron | Removed | Replacement | @@ -230,34 +244,33 @@ All three `nativeDb` fields and `IModelHost.platform` have always been `@interna | `ElectronApp.callDialog` | [ElectronApp.dialogIpc]($electron) | | `ElectronHost.getWindowSizeSetting` | [ElectronHost.getWindowSizeAndPositionSetting]($electron) | - #### @itwin/core-frontend -| **Removed** | **Replacement** | -|-------------------------------------------|--------------------------------------------------------------------------------------------------------------| -| `callIpcHost` | Use `appFunctionIpc` instead. | -| `callNativeHost` | Use `nativeAppIpc` instead. | -| `createMaterial` | Use `createRenderMaterial` instead. | -| `createTextureFromImage` | Use `createTexture` instead. | -| `createTextureFromImageBuffer` | Use `createTexture` instead. | -| `createTextureFromImageSource` | Use `RenderSystem.createTextureFromSource` instead. | -| `displayStyleState.getThumbnail` | N/A (in almost all cases it throws "no content" due to no thumbnail existing.) | -| `GraphicBuilder.pickId` | Deprecated in 3.x. Maintain the current pickable ID yourself. | +| **Removed** | **Replacement** | +| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `callIpcHost` | Use `appFunctionIpc` instead. | +| `callNativeHost` | Use `nativeAppIpc` instead. | +| `createMaterial` | Use `createRenderMaterial` instead. | +| `createTextureFromImage` | Use `createTexture` instead. | +| `createTextureFromImageBuffer` | Use `createTexture` instead. | +| `createTextureFromImageSource` | Use `RenderSystem.createTextureFromSource` instead. | +| `displayStyleState.getThumbnail` | N/A (in almost all cases it throws "no content" due to no thumbnail existing.) | +| `GraphicBuilder.pickId` | Deprecated in 3.x. Maintain the current pickable ID yourself. | | `getDisplayedExtents` | These extents are based on `IModelConnection.displayedExtents`. Consider `computeFitRange` or `getViewedExtents`. | -| `IModelConnection.displayedExtents` | N/A | -| `IModelConnection.expandDisplayedExtents` | Use `displayedExtents` instead. | -| `IModelConnection.query` | Use `createQueryReader` instead (same parameter). | -| `IModelConnection.queryRowCount` | Count the number of results using `count(*)` with a subquery, e.g., `SELECT count(*) FROM ()`. | -| `IModelConnection.restartQuery` | Use `createQueryReader`. Pass the restart token in the `config` argument, e.g., `{ restartToken: myToken }`. | -| `requestDownloadBriefcase(progress)` | `progress` is removed, use `DownloadBriefcaseOptions.progressCallback` instead. | -| `readImage` | Use `readImageBuffer` instead. | -| `setEventController` | Removed (was for internal use). | -| `PullChangesOptions.progressCallback` | Use `downloadProgressCallback` instead. | +| `IModelConnection.displayedExtents` | N/A | +| `IModelConnection.expandDisplayedExtents` | Use `displayedExtents` instead. | +| `IModelConnection.query` | Use `createQueryReader` instead (same parameter). | +| `IModelConnection.queryRowCount` | Count the number of results using `count(*)` with a subquery, e.g., `SELECT count(*) FROM ()`. | +| `IModelConnection.restartQuery` | Use `createQueryReader`. Pass the restart token in the `config` argument, e.g., `{ restartToken: myToken }`. | +| `requestDownloadBriefcase(progress)` | `progress` is removed, use `DownloadBriefcaseOptions.progressCallback` instead. | +| `readImage` | Use `readImageBuffer` instead. | +| `setEventController` | Removed (was for internal use). | +| `PullChangesOptions.progressCallback` | Use `downloadProgressCallback` instead. | #### @itwin/core-geometry -| Removed | Replacement | -| --------------------- | ----------- | +| Removed | Replacement | +| ------------------------------------------------- | ------------------------------------------- | | `PathFragment.childFractionTChainDistance` | `PathFragment.childFractionToChainDistance` | | `GrowableXYArray.setXYZAtCheckedPointIndex` | `GrowableXYArray.setXYAtCheckedPointIndex` | | `PolyfaceBuilder.findOrAddPoint` | `PolyfaceBuilder.addPoint` | @@ -289,11 +302,11 @@ The following APIs were re-exported from `@itwin/core-bentley` and have been rem As of iTwin.js 5.0, the following packages have been removed and are no longer available: -| Removed | Replacement | -| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `@itwin/backend-webpack-tools` | Previously we recommended bundling backends via tools like webpack to decrease the deployed backend size, however we no longer recommend bundling backends at all. | -| `@itwin/core-telemetry` | No consumable APIs were being published therefore this package has been removed, with no replacement available. Please implement your own telemetry client. | -| `@itwin/core-webpack-tools` | We no longer recommend using [webpack](https://webpack.js.org/) and instead recommend using [Vite](https://vite.dev/). | +| Removed | Replacement | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `@itwin/backend-webpack-tools` | Previously we recommended bundling backends via tools like webpack to decrease the deployed backend size, however we no longer recommend bundling backends at all. | +| `@itwin/core-telemetry` | No consumable APIs were being published therefore this package has been removed, with no replacement available. Please implement your own telemetry client. | +| `@itwin/core-webpack-tools` | We no longer recommend using [webpack](https://webpack.js.org/) and instead recommend using [Vite](https://vite.dev/). | ### Change to pullMerge