@talend/react-containers
Version:
Provide connected components aka containers for @talend/react-cmf based on @talend/react-components.
61 lines (60 loc) • 3.07 kB
TypeScript
/**
* from a resourceType and an optional resourcePath, return a resource locator
* if resourcePath is provided resourceType is prepend to resourcePath
* @param {String} resourceType
* @param {Array<String>} [resourcePath]
* @return {String || Array<String>}
*/
export function getResourceLocator(resourceType: string, resourcePath?: Array<string>): string;
export function redirect(url: any): Generator<import("redux-saga/effects").PutEffect<{
type: string;
cmf: {
routerReplace: string;
};
}>, void, unknown>;
/**
* Waiting for confirmation event.
* Resolve the resource to delete.
* Call the requested uri.
* Redirect the user.
* @param {string} uri
* @param {string} resourceType
* @param {string} itemId
* @param {Array<String>} [resourcePath]
* @param {string} collectionId - collection which stores resources
* @param {string} resourceUri - uri to delete resource on backend
*/
export function deleteResourceValidate(uri: string, resourceType: string, itemId: string, resourcePath?: Array<string>, collectionId: string, resourceUri: string): Generator<import("redux-saga/effects").CallEffect<any> | import("redux-saga/effects").TakeEffect | import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
type: string;
model: any;
}> | import("redux-saga/effects").PutEffect<{
type: string;
error: any;
}>, void, any>;
export function deleteResourceCancel(): Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").TakeEffect, void, unknown>;
export default getDeleteResourceSagaRouter;
/**
* For Backward compatibility
* Return a saga for delete resource confirmation dialog box.
* Race between cancel and confirm deleting the resource.
* To be used with the sagaRouter
* @param {object} sagaParams the params to setup the saga
* @param {string} sagaParams.uri the uri of the endpoint to make the calls
* @param {string} sagaParams.resourceType the resource type to call delete endpoint ( at least )
* @param {string} sagaParams.redirectUrl url to redirect after delete action is done or cancel
* @param {Array<String>} sagaParams.resourcePath optional
* @param {string} sagaParams.routerParamsAttribute optional param in route to get the resource id
* @param {string} sagaParams.collectionId optional param to specify collection which stores
* resources,if not provided, will use resourceType as collectionId
* @param {string} sagaParams.resourceUri optionsal param, specify the uri to delete resource.
* if not provided, will use ':uri/:resourceType/:resourceId'
*/
declare function getDeleteResourceSagaRouter({ uri, resourceType, redirectUrl, resourcePath, routerParamsAttribute, collectionId, resourceUri, }?: {
uri: string;
resourceType: string;
redirectUrl: string;
resourcePath: Array<string>;
routerParamsAttribute: string;
collectionId: string;
resourceUri: string;
}): (routerParams: any) => Generator<import("redux-saga/effects").RaceEffect<import("redux-saga/effects").CallEffect<void>>, void, unknown>;