Skip to content

Commit

Permalink
Strip internals from package d.ts files (#596)
Browse files Browse the repository at this point in the history
* chore: strip internals from package d.ts files

#592

* remove unnecessary internal tag

* Remove unnessary emtpy lines

* remove unnessary internal tags and remove unnessary export
  • Loading branch information
mojosoeun authored Aug 31, 2023
1 parent f45593f commit 4bd7a07
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 36 deletions.
4 changes: 3 additions & 1 deletion config/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"enabled": false
},
"dtsRollup": {
"enabled": true
"enabled": true,
"untrimmedFilePath": "<projectFolder>/dist/yorkie-js-sdk.d.untrimmed.d.ts",
"publicTrimmedFilePath": "<projectFolder>/dist/yorkie-js-sdk.d.ts"
},
"messages": {
"compilerMessageReporting": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/prune-dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ function extractExportedSymbol(
// symbol. Note that this is not always safe as we might replace the local
// symbol with a less restrictive type.
const localSymbol = typeChecker.getSymbolAtLocation(typeName);
if (localSymbol) {
for (const declaration of localSymbol!.declarations!) {
if (localSymbol?.declarations) {
for (const declaration of localSymbol.declarations) {
if (
ts.isClassDeclaration(declaration) ||
ts.isInterfaceDeclaration(declaration)
Expand Down
1 change: 0 additions & 1 deletion src/document/change/change_pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { TimeTicket } from '@yorkie-js-sdk/src/document/time/ticket';
/**
* `ChangePack` is a unit for delivering changes in a document to the remote.
*
* @internal
*/
export class ChangePack<P extends Indexable> {
/**
Expand Down
1 change: 0 additions & 1 deletion src/document/change/checkpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Long from 'long';
* `Checkpoint` is used to determine the changes sent and received by the
* client. This is immutable.
*
* @internal
**/
export class Checkpoint {
private serverSeq: Long;
Expand Down
3 changes: 0 additions & 3 deletions src/document/crdt/counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import {
} from '@yorkie-js-sdk/src/document/crdt/primitive';
import { removeDecimal } from '@yorkie-js-sdk/src/util/number';

/**
* @internal
*/
export enum CounterType {
IntegerCnt,
LongCnt,
Expand Down
1 change: 0 additions & 1 deletion src/document/crdt/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export abstract class CRDTElement {
/**
*
* `CRDTContainer` represents CRDTArray or CRDtObject.
* @internal
*/
export abstract class CRDTContainer extends CRDTElement {
constructor(createdAt: TimeTicket) {
Expand Down
1 change: 0 additions & 1 deletion src/document/crdt/element_rht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class ElementRHTNode {
/**
* ElementRHT is a hashtable with logical clock(Replicated hashtable)
*
* @internal
*/
export class ElementRHT {
private nodeMapByKey: Map<string, ElementRHTNode>;
Expand Down
1 change: 0 additions & 1 deletion src/document/crdt/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { ElementRHT } from '@yorkie-js-sdk/src/document/crdt/element_rht';
* `CRDTObject` represents an object data type, but unlike regular JSON,
* it has `TimeTicket`s which are created by logical clock.
*
* @internal
*/
export class CRDTObject extends CRDTContainer {
private memberNodes: ElementRHT;
Expand Down
4 changes: 0 additions & 4 deletions src/document/crdt/rga_tree_split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ export class RGATreeSplitPos {
}
}

/**
* @internal
*/
export type RGATreeSplitPosRange = [RGATreeSplitPos, RGATreeSplitPos];

/**
Expand Down Expand Up @@ -492,7 +489,6 @@ export class RGATreeSplitNode<
* reduce the size of CRDT metadata. When an edit occurs on a block,
* the block is split.
*
* @internal
*/
export class RGATreeSplit<T extends RGATreeSplitValue> {
private head: RGATreeSplitNode<T>;
Expand Down
3 changes: 0 additions & 3 deletions src/document/crdt/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { parseObjectValues } from '@yorkie-js-sdk/src/util/object';
/**
* `TextChangeType` is the type of TextChange.
*
* @internal
*/
enum TextChangeType {
Content = 'content',
Expand Down Expand Up @@ -58,7 +57,6 @@ interface TextChange<A = Indexable> extends ValueChange<TextValueType<A>> {
* which has a attributes that expresses the text style.
* Attributes are represented by RHT.
*
* @internal
*/
export class CRDTTextValue {
private attributes: RHT;
Expand Down Expand Up @@ -156,7 +154,6 @@ export class CRDTTextValue {
/**
* `CRDTText` is a custom CRDT data type to represent the contents of text editors.
*
* @internal
*/
export class CRDTText<A extends Indexable = Indexable> extends CRDTGCElement {
private rgaTreeSplit: RGATreeSplit<CRDTTextValue>;
Expand Down
18 changes: 0 additions & 18 deletions src/util/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,18 @@
import { logger } from '@yorkie-js-sdk/src/util/logger';
import { uuid } from '@yorkie-js-sdk/src/util/uuid';

/**
* @internal
*/
export type NextFn<T> = (value: T) => void;

/**
* @internal
*/
export type ErrorFn = (error: Error) => void;

/**
* @internal
*/
export type CompleteFn = () => void;

/**
* @internal
*/
export interface Observer<T> {
next: NextFn<T>;
error?: ErrorFn;
complete?: CompleteFn;
}

/**
* @internal
*/
export type Unsubscribe = () => void;

export interface SubscribeFn<T> {
Expand Down Expand Up @@ -210,9 +195,6 @@ class ObserverProxy<T> implements Observer<T> {
}
}

/**
* @internal
*/
export interface Observable<T> {
subscribe: SubscribeFn<T>;
getProxy?: () => ObserverProxy<T>;
Expand Down

0 comments on commit 4bd7a07

Please sign in to comment.