chapterjs 0.1.4 → 0.2.1

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.
Files changed (82) hide show
  1. package/dist/cli/build.js +9 -10
  2. package/dist/cli/dev.js +29 -16
  3. package/dist/cli/project.d.ts +38 -25
  4. package/dist/cli/project.js +199 -134
  5. package/dist/cli/update-check.d.ts +42 -0
  6. package/dist/cli/update-check.js +125 -0
  7. package/dist/commands/command.d.ts +25 -11
  8. package/dist/commands/command.js +5 -5
  9. package/dist/commands/{convention.d.ts → declaration.d.ts} +24 -11
  10. package/dist/commands/{convention.js → declaration.js} +61 -33
  11. package/dist/commands/tree.d.ts +8 -4
  12. package/dist/commands/tree.js +16 -6
  13. package/dist/components/button.d.ts +13 -13
  14. package/dist/components/button.js +9 -11
  15. package/dist/components/component.d.ts +1 -1
  16. package/dist/components/component.js +1 -1
  17. package/dist/components/custom-id.d.ts +4 -4
  18. package/dist/components/custom-id.js +12 -12
  19. package/dist/components/declaration.d.ts +42 -0
  20. package/dist/components/{convention.js → declaration.js} +76 -73
  21. package/dist/components/declared.d.ts +29 -0
  22. package/dist/components/declared.js +49 -0
  23. package/dist/components/embed.d.ts +13 -12
  24. package/dist/components/embed.js +6 -6
  25. package/dist/components/instance.d.ts +3 -3
  26. package/dist/components/instance.js +2 -2
  27. package/dist/components/modal.d.ts +11 -10
  28. package/dist/components/modal.js +7 -8
  29. package/dist/components/router.d.ts +3 -2
  30. package/dist/components/router.js +14 -19
  31. package/dist/components/select.d.ts +14 -12
  32. package/dist/components/select.js +4 -4
  33. package/dist/events/declaration.d.ts +16 -0
  34. package/dist/events/declaration.js +80 -0
  35. package/dist/events/event.d.ts +42 -5
  36. package/dist/events/event.js +25 -11
  37. package/dist/events/registry.d.ts +1 -10
  38. package/dist/events/router.d.ts +3 -2
  39. package/dist/index.d.ts +11 -9
  40. package/dist/index.js +2 -0
  41. package/dist/loader/generated.d.ts +5 -32
  42. package/dist/loader/generated.js +21 -55
  43. package/dist/loader/loader.d.ts +57 -44
  44. package/dist/loader/loader.js +73 -89
  45. package/dist/main.d.ts +0 -1
  46. package/dist/main.js +2 -3
  47. package/dist/messages/commands.d.ts +3 -3
  48. package/dist/messages/commands.js +29 -10
  49. package/dist/messages/declaration.d.ts +89 -0
  50. package/dist/messages/declaration.js +455 -0
  51. package/dist/messages/messages.d.ts +65 -43
  52. package/dist/messages/messages.js +11 -10
  53. package/dist/messages/phrases.js +1 -1
  54. package/dist/messages/translate.d.ts +4 -4
  55. package/dist/messages/translate.js +4 -4
  56. package/dist/presence/declaration.d.ts +19 -0
  57. package/dist/presence/{convention.js → declaration.js} +13 -28
  58. package/dist/presence/presence.d.ts +7 -7
  59. package/dist/presence/presence.js +5 -5
  60. package/dist/structures/context.d.ts +1 -1
  61. package/dist/structures/interaction.d.ts +2 -2
  62. package/dist/structures/interaction.js +3 -3
  63. package/dist/structures/payload.d.ts +4 -4
  64. package/dist/structures/payload.js +4 -4
  65. package/dist/tasks/declaration.d.ts +16 -0
  66. package/dist/tasks/{convention.js → declaration.js} +14 -36
  67. package/dist/tasks/scheduler.d.ts +3 -1
  68. package/dist/tasks/scheduler.js +4 -4
  69. package/dist/tasks/task.d.ts +8 -9
  70. package/dist/tasks/task.js +6 -7
  71. package/package.json +1 -1
  72. package/dist/components/convention.d.ts +0 -35
  73. package/dist/components/file.d.ts +0 -30
  74. package/dist/components/file.js +0 -52
  75. package/dist/events/convention.d.ts +0 -25
  76. package/dist/events/convention.js +0 -97
  77. package/dist/events/types.d.ts +0 -7
  78. package/dist/events/types.js +0 -48
  79. package/dist/messages/convention.d.ts +0 -89
  80. package/dist/messages/convention.js +0 -347
  81. package/dist/presence/convention.d.ts +0 -26
  82. package/dist/tasks/convention.d.ts +0 -26
@@ -1,26 +0,0 @@
1
- import type { Convention } from '../loader/loader.js';
2
- import { type RawGatewayPresenceUpdate } from '../discord/types/gateway-events.js';
3
- /** The presence file, checked: what the gateway sends. */
4
- export interface LoadedPresence {
5
- /** The Update Presence payload (also sent with Identify). */
6
- readonly raw: RawGatewayPresenceUpdate;
7
- /** What tells one presence from another: the payload, as text. */
8
- readonly key: string;
9
- }
10
- /**
11
- * What a bot without a presence file shows: online, doing nothing. Sent
12
- * when the file is removed while the bot runs.
13
- */
14
- export declare const DEFAULT_PRESENCE: RawGatewayPresenceUpdate;
15
- /**
16
- * `src/presence.ts`: the status of the bot and what it is doing. The file
17
- * exports by default what `presence()` returns:
18
- *
19
- * ```ts
20
- * // src/presence.ts
21
- * import { presence } from 'chapterjs';
22
- *
23
- * export default presence({ activity: { type: 'playing', name: '/help' } });
24
- * ```
25
- */
26
- export declare const presenceConvention: Convention<LoadedPresence>;
@@ -1,26 +0,0 @@
1
- import type { Convention } from '../loader/loader.js';
2
- import { type Schedule } from './schedule.js';
3
- import { type TaskContext } from './task.js';
4
- /** A task file, checked: what the scheduler works with. */
5
- export interface LoadedTask {
6
- /** The name of the task: the path of the file, without extension. */
7
- readonly name: string;
8
- readonly schedule: Schedule;
9
- readonly onStart: boolean;
10
- readonly run: (context: TaskContext) => unknown;
11
- }
12
- /**
13
- * `src/tasks/`: each file is a task, named after its path. It exports by
14
- * default what `task()` returns:
15
- *
16
- * ```ts
17
- * // src/tasks/report.ts
18
- * import { task } from 'chapterjs';
19
- *
20
- * export default task({
21
- * cron: '0 9 * * 1',
22
- * async run({ guilds }) { ... },
23
- * });
24
- * ```
25
- */
26
- export declare const tasksConvention: Convention<LoadedTask>;