nas/app/javascript/mastodon/models/circle.ts

16 lines
442 B
TypeScript

import type { RecordOf } from 'immutable';
import { Record } from 'immutable';
import type { ApiCircleJSON } from 'mastodon/api_types/circles';
type CircleShape = Required<ApiCircleJSON>; // no changes from server shape
export type Circle = RecordOf<CircleShape>;
const CircleFactory = Record<CircleShape>({
id: '',
title: '',
});
export function createCircle(attributes: Partial<CircleShape>) {
return CircleFactory(attributes);
}