1
0
Fork 0
forked from gitea/nas
nas/app/javascript/mastodon/models/list.ts
2024-11-28 12:51:25 +09:00

20 lines
499 B
TypeScript

import type { RecordOf } from 'immutable';
import { Record } from 'immutable';
import type { ApiListJSON } from 'mastodon/api_types/lists';
type ListShape = Required<ApiListJSON>; // no changes from server shape
export type List = RecordOf<ListShape>;
const ListFactory = Record<ListShape>({
id: '',
title: '',
exclusive: false,
replies_policy: 'list',
notify: false,
antennas: [],
});
export function createList(attributes: Partial<ListShape>) {
return ListFactory(attributes);
}