Include dist files
This commit is contained in:
65
native-sidebar/dist/esm/definitions.d.ts
vendored
Normal file
65
native-sidebar/dist/esm/definitions.d.ts
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PluginListenerHandle } from '@capacitor/core';
|
||||
|
||||
/** A network row rendered in the sidebar. Shapes match `global.networks`. */
|
||||
export interface SidebarNetwork {
|
||||
id: number;
|
||||
name: string;
|
||||
abbreviation: string;
|
||||
logo?: string | null;
|
||||
displayOrder?: number;
|
||||
data?: {
|
||||
announcements?: { text: string }[];
|
||||
members?: { id: number }[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface SidebarProfile {
|
||||
id: number;
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
email?: string;
|
||||
image_path?: string | null;
|
||||
}
|
||||
|
||||
export interface SidebarData {
|
||||
/** Origin that serves the UI (quill.js, Sidebar.js, host page). */
|
||||
uiOrigin: string;
|
||||
/** Origin that serves images (logos, avatars). */
|
||||
serverOrigin: string;
|
||||
profile: SidebarProfile;
|
||||
networks: SidebarNetwork[];
|
||||
currentNetworkId?: number | null;
|
||||
/** Current theme key: light | parchment | dark | red. */
|
||||
theme?: string;
|
||||
/** Whether the current user may create networks. */
|
||||
canCreateNetwork?: boolean;
|
||||
}
|
||||
|
||||
/** An action forwarded from the sidebar's content web view to the main app. */
|
||||
export interface SidebarAction {
|
||||
type: 'selectNetwork' | 'openProfile' | 'createNetwork' | 'setTheme' | 'logout';
|
||||
abbreviation?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export interface NativeSidebarPlugin {
|
||||
/** Create (pre-warm) the drawer if needed and push the latest data into it. */
|
||||
setData(data: SidebarData): Promise<void>;
|
||||
/** Update just the theme (key) without re-sending all data. */
|
||||
setTheme(options: { theme: string }): Promise<void>;
|
||||
/** Animate the drawer open. */
|
||||
open(): Promise<void>;
|
||||
/** Animate the drawer closed. */
|
||||
close(): Promise<void>;
|
||||
/** Enable/disable the edge-drag gesture (disabled on deep routes). */
|
||||
setEnabled(options: { enabled: boolean }): Promise<void>;
|
||||
/** Tear down the drawer entirely. */
|
||||
dismiss(): Promise<void>;
|
||||
|
||||
/** Fires when the user taps something in the sidebar content. */
|
||||
addListener(eventName: 'action', listenerFunc: (data: SidebarAction) => void): Promise<PluginListenerHandle>;
|
||||
/** Fires when the drawer finishes opening/closing. */
|
||||
addListener(eventName: 'stateChange', listenerFunc: (data: { open: boolean }) => void): Promise<PluginListenerHandle>;
|
||||
|
||||
removeAllListeners(): Promise<void>;
|
||||
}
|
||||
1
native-sidebar/dist/esm/definitions.js
vendored
Normal file
1
native-sidebar/dist/esm/definitions.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
4
native-sidebar/dist/esm/index.d.ts
vendored
Normal file
4
native-sidebar/dist/esm/index.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { NativeSidebarPlugin } from './definitions';
|
||||
declare const NativeSidebar: NativeSidebarPlugin;
|
||||
export * from './definitions';
|
||||
export { NativeSidebar };
|
||||
8
native-sidebar/dist/esm/index.js
vendored
Normal file
8
native-sidebar/dist/esm/index.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { registerPlugin } from '@capacitor/core';
|
||||
|
||||
const NativeSidebar = registerPlugin('NativeSidebar', {
|
||||
web: () => import('./web').then(m => new m.NativeSidebarWeb()),
|
||||
});
|
||||
|
||||
export * from './definitions';
|
||||
export { NativeSidebar };
|
||||
11
native-sidebar/dist/esm/web.d.ts
vendored
Normal file
11
native-sidebar/dist/esm/web.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { WebPlugin } from '@capacitor/core';
|
||||
import type { NativeSidebarPlugin } from './definitions';
|
||||
export declare class NativeSidebarWeb extends WebPlugin implements NativeSidebarPlugin {
|
||||
setData(): Promise<void>;
|
||||
setTheme(): Promise<void>;
|
||||
open(): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
setEnabled(): Promise<void>;
|
||||
dismiss(): Promise<void>;
|
||||
addListener(eventName: any, listenerFunc: any): Promise<any>;
|
||||
}
|
||||
13
native-sidebar/dist/esm/web.js
vendored
Normal file
13
native-sidebar/dist/esm/web.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { WebPlugin } from '@capacitor/core';
|
||||
|
||||
// No-op web implementation so the plugin import resolves in the browser build.
|
||||
// The drawer is iOS-native only; on web these methods are never the active path
|
||||
// but must exist to avoid runtime crashes.
|
||||
export class NativeSidebarWeb extends WebPlugin {
|
||||
async setData() { /* no-op on web */ }
|
||||
async setTheme() { /* no-op on web */ }
|
||||
async open() { /* no-op on web */ }
|
||||
async close() { /* no-op on web */ }
|
||||
async setEnabled() { /* no-op on web */ }
|
||||
async dismiss() { /* no-op on web */ }
|
||||
}
|
||||
Reference in New Issue
Block a user