Skip to content

Commit

Permalink
chore: fixed tsdoc missing deprecation messages (#6460)
Browse files Browse the repository at this point in the history
* chore: added missing deprecation messages for `core/renderers/common/block_rendering.ts`

* chore: added missing deprecation messages for `core/utils.ts`

* chore: updated format

* fix: reverted runAfterPageLoad to internal and updated messaging
  • Loading branch information
btw17 authored Sep 30, 2022
1 parent fa925e8 commit e0b60cb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
5 changes: 0 additions & 5 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,6 @@
},
"tsdoc-escape-right-brace": {
"logLevel": "none"
},

// Needs to be fixed
"tsdoc-missing-deprecation-message": {
"logLevel": "none"
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions core/renderers/common/block_rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ import {Renderer} from './renderer.js';
*
* @returns Whether the debugger is turned on.
* @alias Blockly.blockRendering.isDebuggerEnabled
* @deprecated
* @deprecated Use the debug renderer in **\@blockly/dev-tools** (See {@link
* https://www.npmjs.com/package/@blockly/dev-tools}.)
* @internal
*/
export function isDebuggerEnabled(): boolean {
Expand Down Expand Up @@ -90,7 +91,8 @@ export function unregister(name: string) {
* Turn on the blocks debugger.
*
* @alias Blockly.blockRendering.startDebugger
* @deprecated
* @deprecated Use the debug renderer in **\@blockly/dev-tools** (See {@link
* https://www.npmjs.com/package/@blockly/dev-tools}.)
* @internal
*/
export function startDebugger() {
Expand All @@ -105,7 +107,8 @@ export function startDebugger() {
* Turn off the blocks debugger.
*
* @alias Blockly.blockRendering.stopDebugger
* @deprecated
* @deprecated Use the debug renderer in **\@blockly/dev-tools** (See {@link
* https://www.npmjs.com/package/@blockly/dev-tools}.)
* @internal
*/
export function stopDebugger() {
Expand Down
41 changes: 21 additions & 20 deletions core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export {
* Halts the propagation of the event without doing anything else.
*
* @param e An event.
* @deprecated
* @deprecated No longer provided by Blockly.
* @alias Blockly.utils.noEvent
*/
export function noEvent(e: Event) {
Expand All @@ -87,7 +87,7 @@ export function noEvent(e: Event) {
*
* @param e An event.
* @returns True if text input.
* @deprecated Use Blockly.browserEvents.isTargetInput instead.
* @deprecated Use **Blockly.browserEvents.isTargetInput** instead.
* @alias Blockly.utils.isTargetInput
*/
export function isTargetInput(e: Event): boolean {
Expand All @@ -103,7 +103,7 @@ export function isTargetInput(e: Event): boolean {
*
* @param element SVG element to find the coordinates of.
* @returns Object with .x and .y properties.
* @deprecated
* @deprecated Use **Blockly.utils.svgMath.getRelativeXY** instead.
* @alias Blockly.utils.getRelativeXY
*/
export function getRelativeXY(element: Element): Coordinate {
Expand All @@ -120,7 +120,7 @@ export function getRelativeXY(element: Element): Coordinate {
* @param element SVG element to find the coordinates of. If this is not a child
* of the div Blockly was injected into, the behaviour is undefined.
* @returns Object with .x and .y properties.
* @deprecated
* @deprecated Use **Blockly.utils.svgMath.getInjectionDivXY** instead.
* @alias Blockly.utils.getInjectionDivXY_
*/
function getInjectionDivXY(element: Element): Coordinate {
Expand All @@ -136,7 +136,7 @@ export const getInjectionDivXY_ = getInjectionDivXY;
*
* @param e Mouse event.
* @returns True if right-click.
* @deprecated Use Blockly.browserEvents.isRightButton instead.
* @deprecated Use **Blockly.browserEvents.isRightButton** instead.
* @alias Blockly.utils.isRightButton
*/
export function isRightButton(e: Event): boolean {
Expand All @@ -154,7 +154,7 @@ export function isRightButton(e: Event): boolean {
* @param svg SVG element.
* @param matrix Inverted screen CTM to use.
* @returns Object with .x and .y properties.
* @deprecated Use Blockly.browserEvents.mouseToSvg instead;
* @deprecated Use **Blockly.browserEvents.mouseToSvg** instead;
* @alias Blockly.utils.mouseToSvg
*/
export function mouseToSvg(
Expand All @@ -170,7 +170,7 @@ export function mouseToSvg(
*
* @param e Mouse event.
* @returns Scroll delta object with .x and .y properties.
* @deprecated Use Blockly.browserEvents.getScrollDeltaPixels instead.
* @deprecated Use **Blockly.browserEvents.getScrollDeltaPixels** instead.
* @alias Blockly.utils.getScrollDeltaPixels
*/
export function getScrollDeltaPixels(e: WheelEvent): {x: number, y: number} {
Expand All @@ -190,7 +190,7 @@ export function getScrollDeltaPixels(e: WheelEvent): {x: number, y: number} {
* @param message Text which might contain string table references and
* interpolation tokens.
* @returns Array of strings and numbers.
* @deprecated
* @deprecated Use **Blockly.utils.parsing.tokenizeInterpolation** instead.
* @alias Blockly.utils.tokenizeInterpolation
*/
export function tokenizeInterpolation(message: string): Array<string|number> {
Expand All @@ -208,7 +208,7 @@ export function tokenizeInterpolation(message: string): Array<string|number> {
* @param message Message, which may be a string that contains string table
* references.
* @returns String with message references replaced.
* @deprecated
* @deprecated Use **Blockly.utils.parsing.replaceMessageReferences** instead.
* @alias Blockly.utils.replaceMessageReferences
*/
export function replaceMessageReferences(message: string|any): string {
Expand All @@ -225,7 +225,7 @@ export function replaceMessageReferences(message: string|any): string {
* @param message Text which might contain string table references.
* @returns True if all message references have matching values.
* Otherwise, false.
* @deprecated
* @deprecated Use **Blockly.utils.parsing.checkMessageReferences** instead.
* @alias Blockly.utils.checkMessageReferences
*/
export function checkMessageReferences(message: string): boolean {
Expand All @@ -239,7 +239,7 @@ export function checkMessageReferences(message: string): boolean {
* Generate a unique ID.
*
* @returns A globally unique ID string.
* @deprecated Use Blockly.utils.idGenerator.genUid instead.
* @deprecated Use **Blockly.utils.idGenerator.genUid** instead.
* @alias Blockly.utils.genUid
*/
export function genUid(): string {
Expand All @@ -254,7 +254,7 @@ export function genUid(): string {
* and attempting to set the property.
*
* @returns True if 3D transforms are supported.
* @deprecated
* @deprecated Use **Blockly.utils.svgMath.is3dSupported** instead.
* @alias Blockly.utils.is3dSupported
*/
export function is3dSupported(): boolean {
Expand All @@ -271,7 +271,7 @@ export function is3dSupported(): boolean {
* @returns An object containing window width, height, and scroll position in
* window coordinates.
* @alias Blockly.utils.getViewportBBox
* @deprecated
* @deprecated Use **Blockly.utils.svgMath.getViewportBBox** instead.
* @internal
*/
export function getViewportBBox(): Rect {
Expand All @@ -288,12 +288,13 @@ export function getViewportBBox(): Rect {
* @param value Value to remove.
* @returns True if an element was removed.
* @alias Blockly.utils.arrayRemove
* @deprecated
* @deprecated Use **Blockly.array.removeElem** instead.
* @internal
*/
export function arrayRemove<T>(arr: Array<T>, value: T): boolean {
deprecation.warn(
'Blockly.utils.arrayRemove', 'December 2021', 'December 2022');
'Blockly.utils.arrayRemove', 'December 2021', 'December 2022',
'Blockly.array.removeElem');
return arrayUtils.removeElem(arr, value);
}

Expand All @@ -302,7 +303,7 @@ export function arrayRemove<T>(arr: Array<T>, value: T): boolean {
* Copied from Closure's goog.dom.getDocumentScroll.
*
* @returns Object with values 'x' and 'y'.
* @deprecated
* @deprecated Use **Blockly.utils.svgMath.getDocumentScroll** instead.
* @alias Blockly.utils.getDocumentScroll
*/
export function getDocumentScroll(): Coordinate {
Expand All @@ -320,7 +321,7 @@ export function getDocumentScroll(): Coordinate {
* @param opt_stripFollowing Optionally ignore all following statements (blocks
* that are not inside a value or statement input of the block).
* @returns Map of types to type counts for descendants of the bock.
* @deprecated
* @deprecated Use **Blockly.common.getBlockTypeCounts** instead.
* @alias Blockly.utils.getBlockTypeCounts
*/
export function getBlockTypeCounts(
Expand All @@ -337,7 +338,7 @@ export function getBlockTypeCounts(
* @param ws The workspace to find the coordinates on.
* @param screenCoordinates The screen coordinates to be converted to workspace
* coordinates
* @deprecated
* @deprecated Use **Blockly.utils.svgMath.screenToWsCoordinates** instead.
* @returns The workspace coordinates.
*/
export function screenToWsCoordinates(
Expand All @@ -357,7 +358,7 @@ export function screenToWsCoordinates(
* @returns An object containing the colour as a #RRGGBB string, and the hue if
* the input was an HSV hue value.
* @throws {Error} If the colour cannot be parsed.
* @deprecated
* @deprecated Use **Blockly.utils.parsing.parseBlockColour** instead.
* @alias Blockly.utils.parseBlockColour
*/
export function parseBlockColour(colour: number|
Expand All @@ -373,7 +374,7 @@ export function parseBlockColour(colour: number|
*
* @param fn Function to run.
* @throws Error Will throw if no global document can be found (e.g., Node.js).
* @deprecated
* @deprecated No longer provided by Blockly.
* @alias Blockly.utils.runAfterPageLoad
*/
export function runAfterPageLoad(fn: () => void) {
Expand Down

0 comments on commit e0b60cb

Please sign in to comment.