mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add useLightbox and useGalleryLightbox in plugin api (#5936)
This commit is contained in:
@@ -83,6 +83,8 @@ Returns a `Promise<void>` that resolves when all of the components have been loa
|
|||||||
### `hooks`
|
### `hooks`
|
||||||
|
|
||||||
This namespace provides access to the following core utility hooks:
|
This namespace provides access to the following core utility hooks:
|
||||||
|
- `useGalleryLightbox`
|
||||||
|
- `useLightbox`
|
||||||
- `useSpriteInfo`
|
- `useSpriteInfo`
|
||||||
- `useToast`
|
- `useToast`
|
||||||
|
|
||||||
|
|||||||
10
ui/v2.5/src/pluginApi.d.ts
vendored
10
ui/v2.5/src/pluginApi.d.ts
vendored
@@ -1046,6 +1046,16 @@ declare namespace PluginApi {
|
|||||||
uploadScript: (funscriptPath: string) => Promise<void>;
|
uploadScript: (funscriptPath: string) => Promise<void>;
|
||||||
sync: () => Promise<void>;
|
sync: () => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function useLightbox(): {
|
||||||
|
state: any;
|
||||||
|
chapters: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
function useGalleryLightbox(): {
|
||||||
|
id: string;
|
||||||
|
chapters: any;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
namespace patch {
|
namespace patch {
|
||||||
function before(target: PatchableComponentNames, fn: Function): void;
|
function before(target: PatchableComponentNames, fn: Function): void;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import Event from "./hooks/event";
|
|||||||
import { before, instead, after, components, RegisterComponent } from "./patch";
|
import { before, instead, after, components, RegisterComponent } from "./patch";
|
||||||
import { useSettings } from "./components/Settings/context";
|
import { useSettings } from "./components/Settings/context";
|
||||||
import { useInteractive } from "./hooks/Interactive/context";
|
import { useInteractive } from "./hooks/Interactive/context";
|
||||||
|
import { useLightbox, useGalleryLightbox } from "./hooks/Lightbox/hooks";
|
||||||
|
|
||||||
// due to code splitting, some components may not have been loaded when a plugin
|
// due to code splitting, some components may not have been loaded when a plugin
|
||||||
// page is loaded. This function will load all components passed to it.
|
// page is loaded. This function will load all components passed to it.
|
||||||
@@ -161,6 +162,8 @@ export const PluginApi = {
|
|||||||
useToast,
|
useToast,
|
||||||
useSettings,
|
useSettings,
|
||||||
useInteractive,
|
useInteractive,
|
||||||
|
useLightbox,
|
||||||
|
useGalleryLightbox,
|
||||||
},
|
},
|
||||||
patch: {
|
patch: {
|
||||||
// intercept the arguments of supported functions
|
// intercept the arguments of supported functions
|
||||||
|
|||||||
Reference in New Issue
Block a user