-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtypedoc-plugin-phaser-links.cjs
79 lines (59 loc) · 1.72 KB
/
typedoc-plugin-phaser-links.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// @ts-check
const baseLink = 'https://newdocs.phaser.io/docs/3.55.2/Phaser';
// Scene, Game, BlendModes
const knownTopLevel = [
'Scene',
'Game',
'BlendModes'
]
const knownScopedObjects = {
Animation: 'Animations',
AnimationFrame: 'Animations',
AnimationState: 'Animations',
Camera: 'Cameras.Scene2D',
DataManager: 'Data',
BitmapMask: 'Display.Masks',
GeometryMask: 'Display.Masks',
EventEmitter: 'Events',
Container: 'GameObjects',
DisplayList: 'GameObjects',
GameObject: 'GameObjects',
Graphics: 'GameObjects',
Group: 'GameObjects',
Layer: 'GameObjects',
Sprite: 'GameObjects',
TransformMatrix: 'GameObjects.Components',
Rectangle: 'Geom',
Pointer: 'Input',
Vector2: 'Math',
Body: 'Physics.Arcade',
PluginManager: 'Plugins',
ScenePlugin: 'Plugins',
WebGLPipeline: 'Renderer.WebGL',
PostFXPipeline: 'Renderer.WebGL.Pipelines',
Systems: 'Scenes',
CanvasTexture: 'Textures',
Frame: 'Textures',
Texture: 'Textures',
TimerEvent: 'Time',
PlayAnimationConfig: 'Types.Animations',
JSONGameObject: 'Types.GameObjects',
HitAreaCallback: 'Types.Input',
InteractiveObject: 'Types.Input',
Vector2Like: 'Types.Math',
Vector3Like: 'Types.Math',
Vector4Like: 'Types.Math',
};
/**
* @param {import('typedoc').Application} app
*/
exports.load = function load(app) {
app.renderer.addUnknownSymbolResolver("phaser", name => {
if (knownScopedObjects.hasOwnProperty(name)) {
return `${baseLink}.${knownScopedObjects[name]}.${name}`;
} else if (knownTopLevel.includes(name)) {
return `${baseLink}.${name}`;
}
return undefined;
});
}