Skip to content

Commit

Permalink
Explicitly export types not referenced by exported types (#822)
Browse files Browse the repository at this point in the history
Fixes #686
  • Loading branch information
aniketh-varma authored Oct 16, 2024
1 parent fe6ca82 commit 04216e4
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@types/flat": "^5.0.2",
"@types/karma": "^6.3.3",
"@types/lodash": "4.14.179",
"@types/mocha": "9.1.0",
"@types/mocha": "^9.1.0",
"@types/ms": "0.7.31",
"@types/node": "^18.13.0",
"@types/randombytes": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/event-log/event-log-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createLevelDatabase } from '../store/level-wrapper.js';
import { IndexLevel } from '../store/index-level.js';
import { monotonicFactory } from 'ulidx';

type EventLogLevelConfig = {
export type EventLogLevelConfig = {
/**
* must be a directory path (relative or absolute) where
* LevelDB will store its files, or in browsers, the name of the
Expand Down
36 changes: 21 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
export type { DwnConfig } from './dwn.js';
export type { EventLog } from './types/event-log.js';
export type { EventListener, EventStream, EventSubscription, MessageEvent, SubscriptionReply } from './types/subscriptions.js';
export type { GenericMessage, GenericMessageReply, MessageSort, MessageSubscription, Pagination, QueryResultEntry } from './types/message-types.js';
export type { MessagesFilter, MessagesReadMessage as MessagesReadMessage, MessagesReadReply as MessagesReadReply, MessagesReadReplyEntry as MessagesReadReplyEntry, MessagesQueryMessage, MessagesQueryReply, MessagesSubscribeDescriptor, MessagesSubscribeMessage, MessagesSubscribeReply, MessageSubscriptionHandler } from './types/messages-types.js';
export type { Filter, EqualFilter, OneOfFilter, RangeFilter, RangeCriterion, PaginationCursor, QueryOptions } from './types/query-types.js';
export type { ProtocolsConfigureDescriptor, ProtocolDefinition, ProtocolTypes, ProtocolRuleSet, ProtocolsQueryFilter, ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply } from './types/protocols-types.js';
export type { AuthorizationModel, Descriptor, DelegatedGrantRecordsWriteMessage, GenericMessage, GenericMessageReply, GenericSignaturePayload, MessageSort, MessageSubscription, Pagination, QueryResultEntry, Status } from './types/message-types.js';
export type { MessagesFilter, MessagesReadMessage as MessagesReadMessage, MessagesReadReply as MessagesReadReply, MessagesReadReplyEntry as MessagesReadReplyEntry, MessagesReadDescriptor, MessagesQueryDescriptor, MessagesQueryMessage, MessagesQueryReply, MessagesSubscribeDescriptor, MessagesSubscribeMessage, MessagesSubscribeReply, MessageSubscriptionHandler, MessagesSubscribeMessageOptions } from './types/messages-types.js';
export type { GT, LT, Filter, FilterValue, KeyValues, EqualFilter, OneOfFilter, RangeFilter, RangeCriterion, PaginationCursor, QueryOptions, RangeValue, StartsWithFilter } from './types/query-types.js';
export type { ProtocolsConfigureDescriptor, ProtocolDefinition, ProtocolTypes, ProtocolRuleSet, ProtocolsQueryFilter, ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply, ProtocolActionRule, ProtocolPathEncryption, ProtocolsQueryDescriptor, ProtocolType } from './types/protocols-types.js';
export type { DataEncodedRecordsWriteMessage, EncryptedKey, EncryptionProperty, RecordsDeleteMessage, RecordsFilter, RecordsQueryMessage, RecordsQueryReply, RecordsQueryReplyEntry, RecordsReadMessage, RecordsReadReply, RecordsSubscribeDescriptor, RecordsSubscribeMessage, RecordsSubscribeReply, RecordSubscriptionHandler, RecordsWriteDescriptor, RecordsWriteTags, RecordsWriteTagValue, RecordsWriteMessage, RecordsWriteSignaturePayload, RecordsDeleteDescriptor, RecordsQueryDescriptor, RecordsReadDescriptor, RecordsSubscribeMessageOptions, RecordsWriteMessageOptions, InternalRecordsWriteMessage, RecordEvent, RecordsWriteTagsFilter } from './types/records-types.js';
export type { GeneralJws, SignatureEntry } from './types/jws-types.js';
export { authenticate } from './core/auth.js';
export { ActiveTenantCheckResult, AllowAllTenantGate, TenantGate } from './core/tenant-gate.js';
export { Cid } from './utils/cid.js';
Expand All @@ -14,26 +16,27 @@ export { DataStore, DataStorePutResult, DataStoreGetResult } from './types/data-
export { ResumableTaskStore, ManagedResumableTask } from './types/resumable-task-store.js';
export { DataStream } from './utils/data-stream.js';
export { DerivedPrivateJwk, HdKey, KeyDerivationScheme } from './utils/hd-key.js';
export { Dwn } from './dwn.js';
export { Dwn, MessageOptions } from './dwn.js';
export { DwnConstant } from './core/dwn-constant.js';
export { DwnError, DwnErrorCode } from './core/dwn-error.js';
export { DwnInterfaceName, DwnMethodName } from './enums/dwn-interface-method.js';
export { Encoder } from './utils/encoder.js';
export { MessagesSubscribe as MessagesSubscribe, MessagesSubscribeOptions as MessagesSubscribeOptions } from './interfaces/messages-subscribe.js';
export { Encryption, EncryptionAlgorithm } from './utils/encryption.js';
export { Encryption, EncryptionAlgorithm, EciesEncryptionOutput, EciesEncryptionInput } from './utils/encryption.js';
export { EncryptionInput, KeyEncryptionInput, RecordsWrite, RecordsWriteOptions, CreateFromOptions } from './interfaces/records-write.js';
export { executeUnlessAborted } from './utils/abort.js';
export { Jws } from './utils/jws.js';
export { KeyMaterial, PrivateJwk, PublicJwk } from './types/jose-types.js';
export { KeyMaterial, PrivateJwk, PublicJwk, Jwk } from './types/jose-types.js';
export { Message } from './core/message.js';
export { MessagesRead as MessagesRead, MessagesReadOptions as MessagesReadOptions } from './interfaces/messages-read.js';
export { MessagesQuery, MessagesQueryOptions } from './interfaces/messages-query.js';
export { UnionMessageReply } from './core/message-reply.js';
export { MessageStore, MessageStoreOptions } from './types/message-store.js';
export { MessageInterface } from './types/message-interface.js';
export { PermissionGrant } from './protocols/permission-grant.js';
export { PermissionRequest } from './protocols/permission-request.js';
export { PermissionsProtocol } from './protocols/permissions.js';
export { PrivateKeySigner } from './utils/private-key-signer.js';
export { PermissionsProtocol, PermissionGrantCreateOptions, PermissionRequestCreateOptions, PermissionRevocationCreateOptions } from './protocols/permissions.js';
export { PrivateKeySigner, PrivateKeySignerOptions } from './utils/private-key-signer.js';
export { Protocols } from './utils/protocols.js';
export { ProtocolsConfigure, ProtocolsConfigureOptions } from './interfaces/protocols-configure.js';
export { ProtocolsQuery, ProtocolsQueryOptions } from './interfaces/protocols-query.js';
Expand All @@ -50,12 +53,15 @@ export * from './types/permission-types.js';
export * from './types/records-types.js';

// concrete implementations of stores and event stream
export { DataStoreLevel } from './store/data-store-level.js';
export { EventLogLevel } from './event-log/event-log-level.js';
export { MessageStoreLevel } from './store/message-store-level.js';
export { ResumableTaskStoreLevel } from './store/resumable-task-store-level.js';
export { EventEmitterStream } from './event-log/event-emitter-stream.js';
export { BlockstoreLevel, BlockstoreLevelConfig } from './store/blockstore-level.js';
export { DataStoreLevel, DataStoreLevelConfig } from './store/data-store-level.js';
export { EventLogLevel, EventLogLevelConfig } from './event-log/event-log-level.js';
export { IndexLevel, IndexLevelConfig, IndexedItem, IndexLevelOptions } from './store/index-level.js';
export { createLevelDatabase, CreateLevelDatabaseOptions, LevelDatabase, LevelWrapper, LevelWrapperConfig, LevelWrapperBatchOperation, LevelWrapperOptions, LevelWrapperIteratorOptions } from './store/level-wrapper.js';
export { MessageStoreLevel, MessageStoreLevelConfig } from './store/message-store-level.js';
export { ResumableTaskStoreLevel, ResumableTaskStoreLevelConfig } from './store/resumable-task-store-level.js';
export { EventEmitterStream, EventEmitterStreamConfig } from './event-log/event-emitter-stream.js';

// test library exports
export { Persona, TestDataGenerator } from '../tests/utils/test-data-generator.js';
export { GenerateFromRecordsWriteOut, GenerateGrantCreateOutput, GenerateMessagesQueryOutput, GenerateMessagesReadOutput, GenerateMessagesSubscribeOutput, GenerateProtocolsConfigureOutput, GenerateProtocolsQueryOutput, GenerateRecordsDeleteOutput, GenerateRecordsQueryOutput, GenerateRecordsSubscribeOutput, GenerateRecordsWriteOutput, Persona, TestDataGenerator, GenerateFromRecordsWriteInput, GenerateGrantCreateInput, GenerateMessagesQueryInput, GenerateMessagesReadInput, GenerateMessagesSubscribeInput, GenerateProtocolsConfigureInput, GenerateProtocolsQueryInput, GenerateRecordsDeleteInput, GenerateRecordsQueryInput, GenerateRecordsSubscribeInput, GenerateRecordsWriteInput } from '../tests/utils/test-data-generator.js';
export { Poller } from '../tests/utils/poller.js';
2 changes: 1 addition & 1 deletion src/store/blockstore-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class BlockstoreLevel implements Blockstore {
}
}

type BlockstoreLevelConfig = {
export type BlockstoreLevelConfig = {
location: string,
createLevelDatabase?: typeof createLevelDatabase,
};
2 changes: 1 addition & 1 deletion src/store/data-store-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class DataStoreLevel implements DataStore {
}
}

type DataStoreLevelConfig = {
export type DataStoreLevelConfig = {
blockstoreLocation?: string,
createLevelDatabase?: typeof createLevelDatabase,
};
2 changes: 1 addition & 1 deletion src/store/index-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createLevelDatabase, LevelWrapper } from './level-wrapper.js';
import { DwnError, DwnErrorCode } from '../core/dwn-error.js';
import { FilterSelector, FilterUtility } from '../utils/filter.js';

type IndexLevelConfig = {
export type IndexLevelConfig = {
location: string,
createLevelDatabase?: typeof createLevelDatabase
};
Expand Down
2 changes: 1 addition & 1 deletion src/store/level-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class LevelWrapper<V> {
}
}

type LevelWrapperConfig<V> = CreateLevelDatabaseOptions<V> & {
export type LevelWrapperConfig<V> = CreateLevelDatabaseOptions<V> & {
location: string,
createLevelDatabase?: typeof createLevelDatabase,
};
2 changes: 1 addition & 1 deletion src/store/message-store-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class MessageStoreLevel implements MessageStore {
}
}

type MessageStoreLevelConfig = {
export type MessageStoreLevelConfig = {
blockstoreLocation?: string,
indexLocation?: string,
createLevelDatabase?: typeof createLevelDatabase,
Expand Down
2 changes: 1 addition & 1 deletion src/store/resumable-task-store-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ManagedResumableTask, ResumableTaskStore } from '../types/resumabl
import { Cid } from '../utils/cid.js';
import { createLevelDatabase, LevelWrapper } from './level-wrapper.js';

type ResumableTaskStoreLevelConfig = {
export type ResumableTaskStoreLevelConfig = {
location?: string,
createLevelDatabase?: typeof createLevelDatabase
};
Expand Down
4 changes: 2 additions & 2 deletions src/types/message-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type AuthorizationModel = {
ownerDelegatedGrant?: DelegatedGrantRecordsWriteMessage;
};

type DelegatedGrantRecordsWriteMessage = {
export type DelegatedGrantRecordsWriteMessage = {
authorization: {
/**
* The signature of the author.
Expand Down Expand Up @@ -116,7 +116,7 @@ export type Pagination = {
limit?: number;
};

type Status = {
export type Status = {
code: number
detail: string
};
Expand Down

0 comments on commit 04216e4

Please sign in to comment.