-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(isolated_declarations): add
stripInternal
(#5878)
- Loading branch information
Showing
15 changed files
with
281 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
crates/oxc_isolated_declarations/tests/fixtures/strip-internal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
@internal | ||
*/ | ||
class StripInternalClass { | ||
public test() { | ||
console.log("test"); | ||
} | ||
} | ||
|
||
class StripInternalClassFields { | ||
/** | ||
* @internal | ||
*/ | ||
internalProperty: string = "internal"; | ||
|
||
// @internal | ||
internalMethod(): void {} | ||
} | ||
|
||
/** | ||
@internal | ||
*/ | ||
function stripInternalFunction() { | ||
console.log("test"); | ||
} | ||
|
||
export { stripInternalFunction, StripInternalClass, StripInternalClassFields }; | ||
|
||
/** | ||
@internal | ||
*/ | ||
export function stripInternalExportedFunction() { | ||
console.log("test"); | ||
} | ||
|
||
/** | ||
@internal*/ | ||
export const stripInternalExportedConst = "test"; | ||
|
||
/** | ||
@internal*/ | ||
export interface StripInternalExportedInterface {} | ||
|
||
export interface StripInternalInterfaceSignatures { | ||
/** | ||
* @internal | ||
*/ | ||
internalMethod(): void; | ||
/** | ||
* @internal | ||
*/ | ||
internalProperty: number; | ||
/**@internal */ | ||
new (): any; | ||
} | ||
|
||
export type StripInternalTypeSignatures = { | ||
/** | ||
* @internal | ||
*/ | ||
internalMethod(): void; | ||
/** | ||
* @internal | ||
*/ | ||
internalProperty: number; | ||
/**@internal */ | ||
new (): any; | ||
}; | ||
|
||
export namespace StripInternalNamespaceInner { | ||
/** | ||
* @internal | ||
*/ | ||
export function internalFunction() { | ||
console.log("test"); | ||
} | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export namespace StripInternalNamespace {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
crates/oxc_isolated_declarations/tests/snapshots/strip-internal.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
source: crates/oxc_isolated_declarations/tests/mod.rs | ||
input_file: crates/oxc_isolated_declarations/tests/fixtures/strip-internal.ts | ||
--- | ||
==================== .D.TS ==================== | ||
|
||
declare class StripInternalClassFields {} | ||
export { stripInternalFunction, StripInternalClass, StripInternalClassFields }; | ||
export interface StripInternalInterfaceSignatures {} | ||
export type StripInternalTypeSignatures = {}; | ||
export declare namespace StripInternalNamespaceInner { | ||
export {}; | ||
} |
Oops, something went wrong.