Skip to content

Commit

Permalink
feat: export all types
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Dec 5, 2023
1 parent a8ed5c1 commit 94a9f75
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "1.3.2",
"version": "1.3.3",
"packageManager": "[email protected]",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-gopeed-ext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-gopeed-ext",
"version": "1.3.2",
"version": "1.3.3",
"keywords": [
"gopeed"
],
Expand Down
7 changes: 2 additions & 5 deletions packages/create-gopeed-ext/templates/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"gopeed": "^1.3.2",
"@gopeed/types": "^1.3.2",
"gopeed": "^1.3.3",
"gopeed-polyfill-webpack-plugin": "^1.0.2",
"prettier": "^3.0.3",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"gopeed-polyfill-webpack-plugin": "^1.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/gopeed-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gopeed/rest",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "dist/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gopeed-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gopeed/types",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "dist/index.js",
"exports": {
Expand Down
11 changes: 6 additions & 5 deletions packages/gopeed/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/* eslint-disable no-unused-vars */
import { Events } from './types/events';

interface Info {
export interface Info {
identity: string;
name: string;
author: string;
title: string;
version: string;
}

interface Logger {
export interface Logger {
debug(message?: unknown, ...optionalParams: unknown[]): void;
info(message?: unknown, ...optionalParams: unknown[]): void;
warn(message?: unknown, ...optionalParams: unknown[]): void;
error(message?: unknown, ...optionalParams: unknown[]): void;
}

type Settings = {
export type Settings = {
[key: string]: unknown;
};

interface Storage {
export interface Storage {
/**
* Returns the current value associated with the given key, or null if the given key does not exist.
* @param key
Expand All @@ -47,7 +47,7 @@ interface Storage {
keys(): string[];
}

interface Gopeed {
export interface Gopeed {
/**
* Register event handlers
*/
Expand Down Expand Up @@ -77,4 +77,5 @@ declare global {
const gopeed: Gopeed;
}

export * from './types/events';
export {};
2 changes: 1 addition & 1 deletion packages/gopeed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gopeed",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "index.js",
"type": "module",
Expand Down
15 changes: 8 additions & 7 deletions packages/gopeed/types/events.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* eslint-disable no-unused-vars */
import { Request, Resource, Task } from '@gopeed/types';

interface OnResovleContext {
export interface OnResovleContext {
req: Request;
res: Resource;
}

interface OnStartContext {
export interface OnStartContext {
task: Task;
}

interface Events {
onResolve(handler: (ctx: OnResovleContext) => void): void;
onStart(handler: (ctx: OnStartContext) => void): void;
}
export type EventOnResolve = (ctx: OnResovleContext) => void;
export type EventOnStart = (ctx: OnStartContext) => void;

export { Events };
export interface Events {
onResolve: EventOnResolve;
onStart: EventOnStart;
}
1 change: 0 additions & 1 deletion typedoc.base.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "https://typedoc.org/schema.json",
"includeVersion": true,
"excludeExternals": true,
"internalModule": "types"
}

0 comments on commit 94a9f75

Please sign in to comment.