Initial commit
This commit is contained in:
3
src/definitions.ts
Normal file
3
src/definitions.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface SocketsPlugin {
|
||||
echo(options: { value: string }): Promise<{ value: string }>;
|
||||
}
|
||||
10
src/index.ts
Normal file
10
src/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { registerPlugin } from '@capacitor/core';
|
||||
|
||||
import type { SocketsPlugin } from './definitions';
|
||||
|
||||
const Sockets = registerPlugin<SocketsPlugin>('Sockets', {
|
||||
web: () => import('./web').then((m) => new m.SocketsWeb()),
|
||||
});
|
||||
|
||||
export * from './definitions';
|
||||
export { Sockets };
|
||||
10
src/web.ts
Normal file
10
src/web.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { WebPlugin } from '@capacitor/core';
|
||||
|
||||
import type { SocketsPlugin } from './definitions';
|
||||
|
||||
export class SocketsWeb extends WebPlugin implements SocketsPlugin {
|
||||
async echo(options: { value: string }): Promise<{ value: string }> {
|
||||
console.log('ECHO', options);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user