Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed Dec 11, 2024
1 parent 212ea7d commit d759cbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const createSecurityExtension = (): jest.Mocked<ISavedObjectsSecurityExtension>

const createSpacesExtension = (): jest.Mocked<ISavedObjectsSpacesExtension> => ({
getCurrentNamespace: jest.fn(),
getSearchableNamespaces: jest.fn(),
asScopedToNamespace: jest.fn().mockImplementation(createSpacesExtension),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const createSecurityExtension = (): jest.Mocked<ISavedObjectsSecurityExtension>

const createSpacesExtension = (): jest.Mocked<ISavedObjectsSpacesExtension> => ({
getCurrentNamespace: jest.fn(),
getSearchableNamespaces: jest.fn(),
asScopedToNamespace: jest.fn().mockImplementation(createSpacesExtension),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export interface ISavedObjectsSpacesExtension {
* option has already been set some other way, this will throw an error.
*/
getCurrentNamespace: (namespace: string | undefined) => string | undefined;
/**
* Given a list of namespace strings, returns a subset that the user is authorized to search in.
* If a wildcard '*' is used, it is expanded to an explicit list of namespace strings.
*/
getSearchableNamespaces: (namespaces: string[] | undefined) => Promise<string[]>;
/**
* Returns a new Saved Objects Spaces Extension scoped to the specified namespace.
* @param namespace Space to which the extension should be scoped to.
Expand Down

0 comments on commit d759cbd

Please sign in to comment.