Skip to content

Commit 8216412

Browse files
authored
[packages] Add @deprecated annotations to deprecated APIs (expo#9959)
# Why _This follows the TS 4.0 update PR: #9960_ Typescript 4.0 comes with support for `@deprecated` annotations, which gives nice VS Code (and probably other IDE) messages informing users about API deprecation. It also marks deprecated methods/properties with ~~Strikethrough~~. See [this](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#deprecated-support) and microsoft/TypeScript#38523 # How - Added appropriate annotations to every possible deprecated Expo API that I found. - Updated existing comments to play nice with VS Code messages Also, added note about dead code in Notifications, which is related to expo#9563 (I forgot to add it then) > Not sure what to do with changelogs ❓ # Test Plan Tested messages in VS Code with _TS 4.0.2_ enabled.
1 parent 7237c28 commit 8216412

File tree

8 files changed

+8
-2
lines changed

8 files changed

+8
-2
lines changed

build/Audio/Recording.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export declare class Recording {
120120
pauseAsync(): Promise<RecordingStatus>;
121121
stopAndUnloadAsync(): Promise<RecordingStatus>;
122122
getURI(): string | null;
123+
/** @deprecated Use `createNewLoadedSoundAsync()` instead */
123124
createNewLoadedSound(initialStatus?: AVPlaybackStatusToSet, onPlaybackStatusUpdate?: ((status: AVPlaybackStatus) => void) | null): Promise<{
124125
sound: Sound;
125126
status: AVPlaybackStatus;

build/Audio/Recording.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/Audio/Recording.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/Audio/Sound.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export declare class Sound implements Playback {
1414
_eventEmitter: EventEmitter;
1515
_coalesceStatusUpdatesInMillis: number;
1616
_onPlaybackStatusUpdate: ((status: AVPlaybackStatus) => void) | null;
17+
/** @deprecated Use `Sound.createAsync()` instead */
1718
static create: (source: AVPlaybackSource, initialStatus?: AVPlaybackStatusToSet, onPlaybackStatusUpdate?: ((status: AVPlaybackStatus) => void) | null, downloadFirst?: boolean) => Promise<{
1819
sound: Sound;
1920
status: AVPlaybackStatus;

build/Audio/Sound.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/Audio/Sound.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Audio/Recording.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ export class Recording {
365365
return this._uri;
366366
}
367367

368+
/** @deprecated Use `createNewLoadedSoundAsync()` instead */
368369
async createNewLoadedSound(
369370
initialStatus: AVPlaybackStatusToSet = {},
370371
onPlaybackStatusUpdate: ((status: AVPlaybackStatus) => void) | null = null

src/Audio/Sound.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class Sound implements Playback {
2626
_coalesceStatusUpdatesInMillis: number = 100;
2727
_onPlaybackStatusUpdate: ((status: AVPlaybackStatus) => void) | null = null;
2828

29+
/** @deprecated Use `Sound.createAsync()` instead */
2930
static create = async (
3031
source: AVPlaybackSource,
3132
initialStatus: AVPlaybackStatusToSet = {},

0 commit comments

Comments
 (0)