@stackend/api
Version:
JS bindings to api.stackend.com
50 lines • 1.69 kB
TypeScript
import { AuthBlog, Blog, GetBlogParams, GetBlogResult } from './index';
import { BlogActions, BlogState } from './blogReducer';
import { Thunk } from '../api';
import { AuthObject } from '../user/privileges';
export declare function receiveBlogs({ entries, authBlogs, authObjects }: {
entries: Array<Blog>;
authBlogs?: Array<AuthBlog>;
authObjects?: {
[blogId: number]: AuthObject;
};
}): BlogActions;
export declare function requestBlogs(): BlogActions;
export declare function invalidateBlogs(): BlogActions;
export declare function clearBlogs(): BlogActions;
/**
* Fetch a Blog and AuthBlog given id or blogKey
* @param params
*/
export declare function fetchBlog(params: GetBlogParams): Thunk<Promise<GetBlogResult>>;
/**
* Get a blog id given its permalink / blogKey
* @param state
* @param blogKey
*/
export declare function getBlogIdFromStore(state: BlogState, blogKey: string): number;
/**
* Get a blog from store given its id
* @param state
* @param blogId
*/
export declare function getBlogById(state: BlogState, blogId: number): Blog | null;
/**
* Get a blog from store given its permalink / blogKey
* @param state
* @param blogKey
*/
export declare function getBlogByPermalink(state: BlogState, blogKey: string): Blog | null;
/**
* Get a blog Auth from store given its id
* @param state
* @param blogId
*/
export declare function getBlogAuthById(state: BlogState, blogId: number): AuthObject | null;
/**
* Get a blog Auth from store given its permalink
* @param state
* @param blogKey
*/
export declare function getBlogAuthByPermalink(state: BlogState, blogKey: string): AuthObject | null;
//# sourceMappingURL=blogActions.d.ts.map