Add definitions for 16 packages of the @feathersjs scope (#22805)

* add various packages in @feathersjs scope

* formatting, make feathers package pass linting.

* add typings for feathersjs core packages:

@feathersjs/authentication
@feathersjs/authentication-client
@feathersjs/authentication-jwt
@feathersjs/authentication-local
@feathersjs/authentication-oauth1
@feathersjs/authentication-oauth2
@feathersjs/configuration
@feathersjs/errors
@feathersjs/express
@feathersjs/feathers
@feathersjs/primus
@feathersjs/primus-client
@feathersjs/rest-client
@feathersjs/socket-commons
@feathersjs/socketio
@feathersjs/socketio-client

* remove unnecessary package.json files

* fix TS versions

* add some tests, fix errors module, add doc comments, minor todos left
This commit is contained in:
Jan Lohage
2018-01-17 11:16:10 -08:00
committed by Wesley Wigham
parent 426d98a191
commit ea29e9588e
69 changed files with 1418 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
declare module '@feathersjs/feathers' {
import { Channel } from '@feathersjs/socket-commons';
import { HookContext } from '@feathersjs/feathers';
export interface ServiceAddons<T> {
publish(callback: (data: T, hook: HookContext<T>) => Channel): this
publish(event: string, callback: (data: T, hook: HookContext<T>) => Channel): this
}
export interface Application<ServiceTypes = {}> {
channel(...names: string[]): Channel;
publish<T>(callback: (data: T, hook: HookContext<T>) => Channel | Channel[]): Application<ServiceTypes>;
publish<T>(event: string, callback: (data: T, hook: HookContext<T>) => Channel | Channel[]): Application<ServiceTypes>;
}
}
@@ -0,0 +1 @@
const dummy: any = null;
+7
View File
@@ -0,0 +1,7 @@
// Type definitions for @feathersjs/socket-commons 3.1
// Project: http://feathersjs.com/
// Definitions by: Jan Lohage <https://github.com/j2L4e>
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript
import './socket-commons';
import './feathers';
+13
View File
@@ -0,0 +1,13 @@
declare module '@feathersjs/socket-commons' {
export type Connection = any; // todo: spec connection
export interface Channel {
join(...connections: Connection[]): this;
leave(...connections: Connection[]): this;
filter(callback: (connection: Connection) => boolean): Channel;
send(data: any): this;
}
}
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@feathersjs/socket-commons": ["feathersjs__socket-commons"],
"@feathersjs/feathers": ["feathersjs__feathers"]
}
},
"files": [
"index.d.ts", "feathersjs__socket-commons-tests.ts"
]
}
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}