@esri/solution-common
Version:
Provides general helper functions for @esri/solution.js.
57 lines (56 loc) • 1.96 kB
TypeScript
/** @license
* Copyright 2020 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ISolutionResource, SolutionResourceType } from "./solution-resource";
/**
* Convert an array of resource strings into an array of ISolutionResources
*
* Used to migrate Solutions to a more extensible resource schema
*
* @param resourceStrings Array of resource paths
*/
export declare function transformResourcePathsToSolutionResources(resourceStrings?: string[]): ISolutionResource[];
/**
* Convert a resource path to a ISolutionResource
*
* @param resourcePath String
*/
export declare function transformResourcePathToSolutionResource(resourcePath: string): ISolutionResource;
/**
* Convert a resource path to a SolutionResourceType
*
* @param resourcePath String
* @private
*/
export declare function _getSolutionResourceTypeFromResourcePath(resourcePath: string): SolutionResourceType;
/**
* Extract the filename from a path
*
* @param path String that is a path
* @private
*/
export declare function _extractFilenameFromResourcePath(path: string): string;
/**
* Convert the resource path into the correct output path
* (aka resource prefix)
*
* Original resource paths encoded information in the path
* including actual sub-folders. The logic is kinda complex
* thus this function has extensive tests
*
* @param path
* @private
*/
export declare function _extractPathFromResourcePath(resourcePath: string): string;