nnews-react 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +575 -0
- package/dist/index.cjs +57 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +534 -0
- package/dist/index.js +29836 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +10 -0
- package/package.json +129 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
import { default as default_2 } from 'react';
|
|
6
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
7
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
8
|
+
import * as React_2 from 'react';
|
|
9
|
+
import { VariantProps } from 'class-variance-authority';
|
|
10
|
+
|
|
11
|
+
export declare interface Article {
|
|
12
|
+
id: number;
|
|
13
|
+
articleId?: number;
|
|
14
|
+
categoryId?: number;
|
|
15
|
+
authorId?: number;
|
|
16
|
+
title: string;
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
excerpt?: string;
|
|
19
|
+
content: string;
|
|
20
|
+
status: ArticleStatus;
|
|
21
|
+
author?: string;
|
|
22
|
+
category?: Category;
|
|
23
|
+
tags?: Tag[];
|
|
24
|
+
visibleToRoles?: string[];
|
|
25
|
+
createdAt?: string | Date;
|
|
26
|
+
updatedAt?: string | Date;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare class ArticleAPI {
|
|
30
|
+
private client;
|
|
31
|
+
constructor(client: AxiosInstance);
|
|
32
|
+
/**
|
|
33
|
+
* List articles with optional filtering by category
|
|
34
|
+
*/
|
|
35
|
+
listArticles(categoryId?: number, page?: number, pageSize?: number): Promise<PagedResult<Article>>;
|
|
36
|
+
/**
|
|
37
|
+
* Filter articles by roles and parent category
|
|
38
|
+
*/
|
|
39
|
+
filterArticles(roles?: string[], parentId?: number, page?: number, pageSize?: number): Promise<PagedResult<Article>>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a single article by ID
|
|
42
|
+
*/
|
|
43
|
+
getArticleById(id: number): Promise<Article>;
|
|
44
|
+
/**
|
|
45
|
+
* Create a new article
|
|
46
|
+
*/
|
|
47
|
+
createArticle(article: ArticleInput): Promise<Article>;
|
|
48
|
+
/**
|
|
49
|
+
* Update an existing article
|
|
50
|
+
*/
|
|
51
|
+
updateArticle(article: ArticleUpdate): Promise<Article>;
|
|
52
|
+
/**
|
|
53
|
+
* Delete an article
|
|
54
|
+
*/
|
|
55
|
+
deleteArticle(id: number): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Transform date strings to Date objects for a single article
|
|
58
|
+
*/
|
|
59
|
+
private transformArticleDate;
|
|
60
|
+
/**
|
|
61
|
+
* Transform date strings to Date objects for paged results
|
|
62
|
+
*/
|
|
63
|
+
private transformArticleDates;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare function ArticleEditor({ article, categories, tags, onSave, onCancel, loading, }: ArticleEditorProps_2): JSX_2.Element;
|
|
67
|
+
|
|
68
|
+
export declare interface ArticleEditorProps {
|
|
69
|
+
articleId?: number;
|
|
70
|
+
initialData?: Partial<ArticleInput>;
|
|
71
|
+
onSave?: (article: Article) => void;
|
|
72
|
+
onCancel?: () => void;
|
|
73
|
+
showPreview?: boolean;
|
|
74
|
+
enableAutoSave?: boolean;
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface ArticleEditorProps_2 {
|
|
79
|
+
article?: Article | null;
|
|
80
|
+
categories?: Category[];
|
|
81
|
+
tags?: Tag[];
|
|
82
|
+
onSave: (article: ArticleInput | ArticleUpdate) => Promise<void>;
|
|
83
|
+
onCancel: () => void;
|
|
84
|
+
loading?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare interface ArticleInput {
|
|
88
|
+
title: string;
|
|
89
|
+
subtitle?: string;
|
|
90
|
+
excerpt?: string;
|
|
91
|
+
content: string;
|
|
92
|
+
status: ArticleStatus;
|
|
93
|
+
author?: string;
|
|
94
|
+
categoryId?: number;
|
|
95
|
+
tagIds?: number[];
|
|
96
|
+
visibleToRoles?: string[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare function ArticleList({ articles, loading, error, onArticleClick, onEditClick, onDeleteClick, showActions, emptyMessage, }: ArticleListProps_2): JSX_2.Element;
|
|
100
|
+
|
|
101
|
+
export declare interface ArticleListProps {
|
|
102
|
+
categoryId?: number;
|
|
103
|
+
status?: ArticleStatus;
|
|
104
|
+
page?: number;
|
|
105
|
+
pageSize?: number;
|
|
106
|
+
onEdit?: (article: Article) => void;
|
|
107
|
+
onDelete?: (articleId: number) => void;
|
|
108
|
+
onView?: (article: Article) => void;
|
|
109
|
+
showCreateButton?: boolean;
|
|
110
|
+
className?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare interface ArticleListProps_2 {
|
|
114
|
+
articles: PagedResult<Article> | null;
|
|
115
|
+
loading?: boolean;
|
|
116
|
+
error?: Error | null;
|
|
117
|
+
onArticleClick?: (article: Article) => void;
|
|
118
|
+
onEditClick?: (article: Article) => void;
|
|
119
|
+
onDeleteClick?: (article: Article) => void;
|
|
120
|
+
showActions?: boolean;
|
|
121
|
+
emptyMessage?: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export declare interface ArticleSearchParams {
|
|
125
|
+
categoryId?: number;
|
|
126
|
+
status?: ArticleStatus;
|
|
127
|
+
tags?: number[];
|
|
128
|
+
roles?: string[];
|
|
129
|
+
searchTerm?: string;
|
|
130
|
+
page?: number;
|
|
131
|
+
pageSize?: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare enum ArticleStatus {
|
|
135
|
+
Draft = 0,
|
|
136
|
+
Published = 1,
|
|
137
|
+
Archived = 2
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export declare interface ArticleUpdate extends ArticleInput {
|
|
141
|
+
id: number;
|
|
142
|
+
articleId?: number;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export declare function ArticleViewer({ article, onBack, onEdit, showActions, }: ArticleViewerProps_2): JSX_2.Element;
|
|
146
|
+
|
|
147
|
+
export declare interface ArticleViewerProps {
|
|
148
|
+
articleId?: number;
|
|
149
|
+
article?: Article;
|
|
150
|
+
onEdit?: (article: Article) => void;
|
|
151
|
+
onBack?: () => void;
|
|
152
|
+
showMetadata?: boolean;
|
|
153
|
+
className?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare interface ArticleViewerProps_2 {
|
|
157
|
+
article: Article;
|
|
158
|
+
onBack?: () => void;
|
|
159
|
+
onEdit?: (article: Article) => void;
|
|
160
|
+
showActions?: boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare const Avatar: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React_2.RefAttributes<HTMLSpanElement>, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
164
|
+
|
|
165
|
+
export declare const AvatarFallback: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React_2.RefAttributes<HTMLSpanElement>, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
166
|
+
|
|
167
|
+
export declare const AvatarImage: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React_2.RefAttributes<HTMLImageElement>, "ref"> & React_2.RefAttributes<HTMLImageElement>>;
|
|
168
|
+
|
|
169
|
+
export declare const Button: React_2.ForwardRefExoticComponent<ButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
170
|
+
|
|
171
|
+
declare interface ButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
172
|
+
asChild?: boolean;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare const buttonVariants: (props?: ({
|
|
176
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
177
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
178
|
+
} & ClassProp) | undefined) => string;
|
|
179
|
+
|
|
180
|
+
export declare interface Category {
|
|
181
|
+
id: number;
|
|
182
|
+
categoryId?: number;
|
|
183
|
+
parentId?: number;
|
|
184
|
+
title: string;
|
|
185
|
+
slug?: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
visibleToRoles?: string[];
|
|
188
|
+
createdAt?: Date;
|
|
189
|
+
updatedAt?: Date;
|
|
190
|
+
articleCount?: number;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare class CategoryAPI {
|
|
194
|
+
private client;
|
|
195
|
+
constructor(client: AxiosInstance);
|
|
196
|
+
/**
|
|
197
|
+
* List all categories
|
|
198
|
+
*/
|
|
199
|
+
listCategories(): Promise<Category[]>;
|
|
200
|
+
/**
|
|
201
|
+
* Filter categories by roles and parent category
|
|
202
|
+
*/
|
|
203
|
+
filterCategories(roles?: string[], parentId?: number): Promise<Category[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Get a single category by ID
|
|
206
|
+
*/
|
|
207
|
+
getCategoryById(id: number): Promise<Category>;
|
|
208
|
+
/**
|
|
209
|
+
* Create a new category
|
|
210
|
+
*/
|
|
211
|
+
createCategory(category: CategoryInput): Promise<Category>;
|
|
212
|
+
/**
|
|
213
|
+
* Update an existing category
|
|
214
|
+
*/
|
|
215
|
+
updateCategory(category: CategoryUpdate): Promise<Category>;
|
|
216
|
+
/**
|
|
217
|
+
* Delete a category
|
|
218
|
+
*/
|
|
219
|
+
deleteCategory(id: number): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Transform date strings to Date objects for a single category
|
|
222
|
+
*/
|
|
223
|
+
private transformCategoryDate;
|
|
224
|
+
/**
|
|
225
|
+
* Transform date strings to Date objects for category arrays
|
|
226
|
+
*/
|
|
227
|
+
private transformCategoryDates;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare interface CategoryFilterParams {
|
|
231
|
+
roles?: string[];
|
|
232
|
+
parentId?: number;
|
|
233
|
+
searchTerm?: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export declare interface CategoryInput {
|
|
237
|
+
title: string;
|
|
238
|
+
slug?: string;
|
|
239
|
+
description?: string;
|
|
240
|
+
parentId?: number;
|
|
241
|
+
visibleToRoles?: string[];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export declare function CategoryList({ categories, loading, error, onCategoryClick, onEditClick, onDeleteClick, showActions, emptyMessage, }: CategoryListProps_2): JSX_2.Element;
|
|
245
|
+
|
|
246
|
+
export declare interface CategoryListProps {
|
|
247
|
+
onEdit?: (category: Category) => void;
|
|
248
|
+
onDelete?: (categoryId: number) => void;
|
|
249
|
+
showCreateButton?: boolean;
|
|
250
|
+
className?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare interface CategoryListProps_2 {
|
|
254
|
+
categories: Category[];
|
|
255
|
+
loading?: boolean;
|
|
256
|
+
error?: Error | null;
|
|
257
|
+
onCategoryClick?: (category: Category) => void;
|
|
258
|
+
onEditClick?: (category: Category) => void;
|
|
259
|
+
onDeleteClick?: (category: Category) => void;
|
|
260
|
+
showActions?: boolean;
|
|
261
|
+
emptyMessage?: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export declare function CategoryModal({ category, categories, isOpen, onClose, onSave, loading, }: CategoryModalProps_2): JSX_2.Element | null;
|
|
265
|
+
|
|
266
|
+
export declare interface CategoryModalProps {
|
|
267
|
+
isOpen: boolean;
|
|
268
|
+
onClose: () => void;
|
|
269
|
+
category?: Category;
|
|
270
|
+
onSave?: (category: Category) => void;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare interface CategoryModalProps_2 {
|
|
274
|
+
category?: Category | null;
|
|
275
|
+
categories?: Category[];
|
|
276
|
+
isOpen: boolean;
|
|
277
|
+
onClose: () => void;
|
|
278
|
+
onSave: (category: CategoryInput | CategoryUpdate) => Promise<void>;
|
|
279
|
+
loading?: boolean;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export declare interface CategoryUpdate extends CategoryInput {
|
|
283
|
+
id: number;
|
|
284
|
+
categoryId?: number;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Debounce function
|
|
291
|
+
*/
|
|
292
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Format document (CPF or CNPJ)
|
|
296
|
+
*/
|
|
297
|
+
export declare function formatDocument(document: string): string;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Format phone number to Brazilian format
|
|
301
|
+
*/
|
|
302
|
+
export declare function formatPhone(phone: string): string;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Format ZIP code (CEP)
|
|
306
|
+
*/
|
|
307
|
+
export declare function formatZipCode(zipCode: string): string;
|
|
308
|
+
|
|
309
|
+
export declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
310
|
+
|
|
311
|
+
declare type InputProps = React_2.InputHTMLAttributes<HTMLInputElement>;
|
|
312
|
+
|
|
313
|
+
export declare const Label: React_2.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React_2.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: ClassProp | undefined) => string> & React_2.RefAttributes<HTMLLabelElement>>;
|
|
314
|
+
|
|
315
|
+
export declare function MarkdownEditor({ value, onChange, placeholder, label, error, minHeight, }: MarkdownEditorProps): JSX_2.Element;
|
|
316
|
+
|
|
317
|
+
declare interface MarkdownEditorProps {
|
|
318
|
+
value: string;
|
|
319
|
+
onChange: (value: string) => void;
|
|
320
|
+
placeholder?: string;
|
|
321
|
+
label?: string;
|
|
322
|
+
error?: string;
|
|
323
|
+
minHeight?: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export declare interface NNewsConfig {
|
|
327
|
+
apiUrl: string;
|
|
328
|
+
apiClient?: AxiosInstance;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export declare interface NNewsContextValue {
|
|
332
|
+
config: NNewsConfig;
|
|
333
|
+
apiClient: AxiosInstance;
|
|
334
|
+
articleApi: ArticleAPI;
|
|
335
|
+
categoryApi: CategoryAPI;
|
|
336
|
+
tagApi: TagAPI;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export declare function NNewsProvider({ config, children }: NNewsProviderProps): JSX_2.Element;
|
|
340
|
+
|
|
341
|
+
export declare interface NNewsProviderProps {
|
|
342
|
+
config: NNewsConfig;
|
|
343
|
+
children: default_2.ReactNode;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare interface PagedResult<T> {
|
|
347
|
+
items: T[];
|
|
348
|
+
page: number;
|
|
349
|
+
pageSize: number;
|
|
350
|
+
totalCount: number;
|
|
351
|
+
totalPages: number;
|
|
352
|
+
hasPrevious: boolean;
|
|
353
|
+
hasNext: boolean;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Validate password strength
|
|
358
|
+
*/
|
|
359
|
+
export declare interface PasswordStrength {
|
|
360
|
+
score: number;
|
|
361
|
+
feedback: string[];
|
|
362
|
+
isValid: boolean;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export declare interface Tag {
|
|
366
|
+
id: number;
|
|
367
|
+
tagId?: number;
|
|
368
|
+
title: string;
|
|
369
|
+
slug?: string;
|
|
370
|
+
articleCount?: number;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export declare class TagAPI {
|
|
374
|
+
private client;
|
|
375
|
+
constructor(client: AxiosInstance);
|
|
376
|
+
/**
|
|
377
|
+
* List all tags
|
|
378
|
+
*/
|
|
379
|
+
listTags(): Promise<Tag[]>;
|
|
380
|
+
/**
|
|
381
|
+
* Get a single tag by ID
|
|
382
|
+
*/
|
|
383
|
+
getTagById(id: number): Promise<Tag>;
|
|
384
|
+
/**
|
|
385
|
+
* Create a new tag
|
|
386
|
+
*/
|
|
387
|
+
createTag(tag: TagInput): Promise<Tag>;
|
|
388
|
+
/**
|
|
389
|
+
* Update an existing tag
|
|
390
|
+
*/
|
|
391
|
+
updateTag(tag: TagUpdate): Promise<Tag>;
|
|
392
|
+
/**
|
|
393
|
+
* Delete a tag
|
|
394
|
+
*/
|
|
395
|
+
deleteTag(id: number): Promise<void>;
|
|
396
|
+
/**
|
|
397
|
+
* Merge two tags (move all articles from source to target, then delete source)
|
|
398
|
+
*/
|
|
399
|
+
mergeTags(sourceTagId: number, targetTagId: number): Promise<void>;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export declare interface TagInput {
|
|
403
|
+
title: string;
|
|
404
|
+
slug?: string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export declare function TagList({ tags, loading, error, onTagClick, onEditClick, onDeleteClick, showActions, emptyMessage, }: TagListProps_2): JSX_2.Element;
|
|
408
|
+
|
|
409
|
+
export declare interface TagListProps {
|
|
410
|
+
onEdit?: (tag: Tag) => void;
|
|
411
|
+
onDelete?: (tagId: number) => void;
|
|
412
|
+
onMerge?: (sourceId: number, targetId: number) => void;
|
|
413
|
+
showCreateButton?: boolean;
|
|
414
|
+
className?: string;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
declare interface TagListProps_2 {
|
|
418
|
+
tags: Tag[];
|
|
419
|
+
loading?: boolean;
|
|
420
|
+
error?: Error | null;
|
|
421
|
+
onTagClick?: (tag: Tag) => void;
|
|
422
|
+
onEditClick?: (tag: Tag) => void;
|
|
423
|
+
onDeleteClick?: (tag: Tag) => void;
|
|
424
|
+
showActions?: boolean;
|
|
425
|
+
emptyMessage?: string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export declare function TagModal({ tag, isOpen, onClose, onSave, loading, }: TagModalProps_2): JSX_2.Element | null;
|
|
429
|
+
|
|
430
|
+
export declare interface TagModalProps {
|
|
431
|
+
isOpen: boolean;
|
|
432
|
+
onClose: () => void;
|
|
433
|
+
tag?: Tag;
|
|
434
|
+
onSave?: (tag: Tag) => void;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
declare interface TagModalProps_2 {
|
|
438
|
+
tag?: Tag | null;
|
|
439
|
+
isOpen: boolean;
|
|
440
|
+
onClose: () => void;
|
|
441
|
+
onSave: (tag: TagInput | TagUpdate) => Promise<void>;
|
|
442
|
+
loading?: boolean;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export declare interface TagSearchParams {
|
|
446
|
+
searchTerm?: string;
|
|
447
|
+
page?: number;
|
|
448
|
+
pageSize?: number;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export declare interface TagUpdate extends TagInput {
|
|
452
|
+
id: number;
|
|
453
|
+
tagId?: number;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Throttle function
|
|
458
|
+
*/
|
|
459
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
460
|
+
|
|
461
|
+
export declare function useArticles(): UseArticlesResult;
|
|
462
|
+
|
|
463
|
+
export declare interface UseArticlesResult {
|
|
464
|
+
articles: PagedResult<Article> | null;
|
|
465
|
+
loading: boolean;
|
|
466
|
+
error: Error | null;
|
|
467
|
+
fetchArticles: (params?: ArticleSearchParams) => Promise<void>;
|
|
468
|
+
getArticleById: (id: number) => Promise<Article>;
|
|
469
|
+
createArticle: (article: ArticleInput) => Promise<Article>;
|
|
470
|
+
updateArticle: (article: ArticleUpdate) => Promise<Article>;
|
|
471
|
+
deleteArticle: (id: number) => Promise<void>;
|
|
472
|
+
refresh: () => Promise<void>;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export declare function useCategories(): UseCategoriesResult;
|
|
476
|
+
|
|
477
|
+
export declare interface UseCategoriesResult {
|
|
478
|
+
categories: Category[];
|
|
479
|
+
loading: boolean;
|
|
480
|
+
error: Error | null;
|
|
481
|
+
fetchCategories: (params?: CategoryFilterParams) => Promise<void>;
|
|
482
|
+
getCategoryById: (id: number) => Promise<Category>;
|
|
483
|
+
createCategory: (category: CategoryInput) => Promise<Category>;
|
|
484
|
+
updateCategory: (category: CategoryUpdate) => Promise<Category>;
|
|
485
|
+
deleteCategory: (id: number) => Promise<void>;
|
|
486
|
+
refresh: () => Promise<void>;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export declare function useNNews(): NNewsContextValue;
|
|
490
|
+
|
|
491
|
+
export declare function useTags(): UseTagsResult;
|
|
492
|
+
|
|
493
|
+
export declare interface UseTagsResult {
|
|
494
|
+
tags: Tag[];
|
|
495
|
+
loading: boolean;
|
|
496
|
+
error: Error | null;
|
|
497
|
+
fetchTags: (params?: TagSearchParams) => Promise<void>;
|
|
498
|
+
getTagById: (id: number) => Promise<Tag>;
|
|
499
|
+
createTag: (tag: TagInput) => Promise<Tag>;
|
|
500
|
+
updateTag: (tag: TagUpdate) => Promise<Tag>;
|
|
501
|
+
deleteTag: (id: number) => Promise<void>;
|
|
502
|
+
mergeTags: (sourceId: number, targetId: number) => Promise<void>;
|
|
503
|
+
refresh: () => Promise<void>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Validate CNPJ (Brazilian company taxpayer registry)
|
|
508
|
+
*/
|
|
509
|
+
export declare function validateCNPJ(cnpj: string): boolean;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Validate CPF (Brazilian individual taxpayer registry)
|
|
513
|
+
*/
|
|
514
|
+
export declare function validateCPF(cpf: string): boolean;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Validate email address
|
|
518
|
+
*/
|
|
519
|
+
export declare function validateEmail(email: string): boolean;
|
|
520
|
+
|
|
521
|
+
export declare function validatePasswordStrength(password: string, options?: {
|
|
522
|
+
minLength?: number;
|
|
523
|
+
requireUppercase?: boolean;
|
|
524
|
+
requireLowercase?: boolean;
|
|
525
|
+
requireNumbers?: boolean;
|
|
526
|
+
requireSpecialChars?: boolean;
|
|
527
|
+
}): PasswordStrength;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Validate Brazilian phone number
|
|
531
|
+
*/
|
|
532
|
+
export declare function validatePhone(phone: string): boolean;
|
|
533
|
+
|
|
534
|
+
export { }
|