@excentone/spfx-react
Version:
Contains custom ReactJs components and hooks intended to use when developing SharePoint Framework (SPFx) Web components.
32 lines (31 loc) • 812 B
TypeScript
import { IFile } from "@pnp/sp/files";
import { IFolder } from "@pnp/sp/folders";
/**
* The string or function that returns the string containing the subfolder name.
*/
export declare type SubfolderName = string | (() => string);
/**
* Options available for `useSpFolder` custom hook.
*/
export interface IUseSPFoldersOptions {
/**
* The name of the root folder.
*/
rootFolderName: string;
/**
*
*/
subFolderNames?: SubfolderName[];
}
/**
* The type returned by `useSpFolder` custom hook.
*/
export declare type SpFolderHook = {
/**
*
* @param subDirectories
* @returns
*/
getSPFolder: (...subDirectories: SubfolderName[]) => Promise<IFolder>;
getSPFileByName: (fileName: string, ...subDirectories: SubfolderName[]) => Promise<IFile>;
};