/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { String } from "../../types/java/lang/String"; import type { RestAppInvoker } from "../../types/senselogic/sitevision/api/script/app/RestAppInvoker"; import type { Node } from "../../types/javax/jcr/Node"; /** * Creates RestAppInvoker instances. * *

* Some code examples *

*

* Below is an example of how to get a {@link RestAppInvoker} instance using the path (of the headless custom module). *

   var restAppInvokerFactory = require('RestAppInvokerFactory'),
 *        restAppInvoker = restAppInvokerFactory.fromPath('/rest-api/my-rest-app');
 *
 *     if (restAppInvoker) {
 *        // Use the RESTApp invoker...
 *     }
* *

* Below is an example of how to get a {@link RestAppInvoker} instance using a Node. Note that the Node must be of type * sv:restApp, sv:headlessCustomModule or sv:marketplaceHeadlessCustomModule. *

   var restAppInvokerFactory = require('RestAppInvokerFactory'),
 *        restAppInvoker = restAppInvokerFactory.fromNode(aNode);
 *
 *     if (restAppInvoker) {
 *        // Use the RESTApp invoker...
 *     }
* *

* Below is an example of how to get a {@link RestAppInvoker} instance using a Node identifier. Note that the identifier must be for a Node of type * sv:restApp, sv:headlessCustomModule or sv:marketplaceHeadlessCustomModule * (i.e. an identifier prefixed "361.", "188." or "211."). *

   var restAppInvokerFactory = require('RestAppInvokerFactory'),
 *        restAppInvoker = restAppInvokerFactory.fromIdentifier(aIdentifier);
 *
 *     if (restAppInvoker) {
 *        // Use the RESTApp invoker...
 *     }
* *

* See {@link RestAppInvoker} for more code examples. *

* @param script object * @author Magnus Lövgren * @since Sitevision 7 * @see RestAppInvoker */ export interface RestAppInvokerFactory { /** * Creates a RestAppInvoker via the Path of a Headless custom module. * @param aPath the path of the Headless custom module (sv:headlessCustomModule or sv:marketplaceHeadlessCustomModule) * @return the RestAppInvoker for the active RESTApp of the module, or null if no matching RESTApp could be found */ fromPath(aPath: String | string): RestAppInvoker; /** * Creates a RestAppInvoker via a RESTApp Node or a Headless custom module Node. * @param aNode the RESTApp (sv:restApp) or the Headless custom module (sv:headlessCustomModule or sv:marketplaceHeadlessCustomModule) * @return the RestAppInvoker for the RESTApp, or null if no matching RESTApp could be found */ fromNode(aNode: Node): RestAppInvoker; /** * Creates a RestAppInvoker via the Identifier of a RESTApp or a Headless custom module. * @param aIdentifier the identifier of the RESTApp (sv:restApp) or the Headless custom module (sv:headlessCustomModule or sv:marketplaceHeadlessCustomModule), i.e. an identifier prefixed with "361.", "188." or "211.". * @return the RestAppInvoker for the resolved RESTApp, or null if no matching RESTApp could be found */ fromIdentifier(aIdentifier: String | string): RestAppInvoker; } declare namespace RestAppInvokerFactory {} declare var restAppInvokerFactory: RestAppInvokerFactory; export default restAppInvokerFactory;