mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-10-08 02:32:09 +00:00
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
/*
|
|
* Copyright (C) 2026 StApps
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
* Software Foundation, version 3.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
export interface URLOpenListenerEvent {
|
|
url: string;
|
|
}
|
|
|
|
export interface AppInfo {
|
|
name: string;
|
|
id: string;
|
|
build: string;
|
|
version: string;
|
|
}
|
|
|
|
export interface PluginListenerHandle {
|
|
remove: () => Promise<void>;
|
|
}
|
|
|
|
export class AppMock {
|
|
addListener<T>(_eventName: string, _listener: (event: T) => void): Promise<PluginListenerHandle> {
|
|
return Promise.resolve({remove: () => Promise.resolve()});
|
|
}
|
|
|
|
getInfo(): Promise<AppInfo> {
|
|
return Promise.resolve({name: 'StApps', id: 'de.anyschool.app', build: '1', version: '1.2.3'});
|
|
}
|
|
}
|
|
|
|
export const App = new AppMock();
|