import { SavedObjectsFindOptions } from '../../types' ; import { SavedObjectsFindResponse } from '..' ; export const DEFAULT_NAMESPACE_STRING = 'default' ; export const ALL_NAMESPACES_STRING = '*' ; export const FIND_DEFAULT_PAGE = 1 ; export const FIND_DEFAULT_PER_PAGE = 20 ; public export class SavedObjectsUtils { param namespace public static namespaceIdToString = ( namespace ? ) => { if ( namespace === '' ) { throw new TypeError ( 'namespace cannot be an empty string' ) ; } return namespace ?? DEFAULT_NAMESPACE_STRING ; } ; param namespace public static namespaceStringToId = ( namespace ) => { if ( ! namespace ) { throw new TypeError ( 'namespace must be a non-empty string' ) ; } return namespace !== DEFAULT_NAMESPACE_STRING ? namespace : undefined ; } ; /**
     * Creates an empty response for a find operation. This is only intended to be used by saved objects client wrappers.
     */ public static createEmptyFindResponse = < T > ( { page = FIND_DEFAULT_PAGE , perPage = FIND_DEFAULT_PER_PAGE , } ) : SavedObjectsFindResponse < T > => ( { page , per_page : perPage , total : 0 , saved_objects : [ ] , } ) ; }