1 module dls.protocol.interfaces.client;
2 
3 import std.typecons : Nullable;
4 
5 private abstract class RegistrationBase
6 {
7     string id;
8     string method;
9 
10     private this(string id, string method)
11     {
12         this.id = id;
13         this.method = method;
14     }
15 }
16 
17 package abstract class RegistrationOptionsBase
18 {
19 }
20 
21 class Registration(R : RegistrationOptionsBase) : RegistrationBase
22 {
23     Nullable!R registerOptions;
24 
25     this(string id = string.init, string method = string.init,
26             Nullable!R registerOptions = Nullable!R.init)
27     {
28         super(id, method);
29         this.registerOptions = registerOptions;
30     }
31 }
32 
33 class TextDocumentRegistrationOptions : RegistrationOptionsBase
34 {
35     import dls.protocol.definitions : DocumentSelector;
36 
37     Nullable!DocumentSelector documentSelector;
38 
39     this(Nullable!DocumentSelector documentSelector = Nullable!DocumentSelector.init)
40     {
41         this.documentSelector = documentSelector;
42     }
43 }
44 
45 class RegistrationParams(R)
46 {
47     Registration!R[] registrations;
48 
49     this(Registration!R[] registrations = Registration!R[].init)
50     {
51         this.registrations = registrations;
52     }
53 }
54 
55 class Unregistration : RegistrationBase
56 {
57     this(string id = string.init, string method = string.init)
58     {
59         super(id, method);
60     }
61 }
62 
63 class UnregistrationParams
64 {
65     Unregistration[] unregistrations;
66 
67     this(Unregistration[] unregistrations = Unregistration[].init)
68     {
69         this.unregistrations = unregistrations;
70     }
71 }