Skip to content

Commit bd5d036

Browse files
committed
clean up names
1 parent c272656 commit bd5d036

File tree

5 files changed

+107
-108
lines changed

5 files changed

+107
-108
lines changed

packages/web-components/fast-foundation/docs/api-report.md

Lines changed: 74 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ export interface Configuration {
227227
readonly prefix: string;
228228
// (undocumented)
229229
register(...registrations: ConfigurationRegistry[]): Configuration;
230-
// Warning: (ae-forgotten-export) The symbol "DesignTokenRegistration" needs to be exported by the entry point index.d.ts
231-
registerDesignToken<T>(registration: DesignTokenRegistration<T>): Configuration;
230+
// Warning: (ae-forgotten-export) The symbol "DesignTokenDefinition" needs to be exported by the entry point index.d.ts
231+
registerDesignToken<T>(registration: DesignTokenDefinition<T>): Configuration;
232232
registerElement(type: typeof FASTElement, definition: PartialFASTElementDefinition): Configuration;
233233
setDefaultStylesFor(baseName: string, styles: ElementStyles | null): Configuration;
234234
setDefaultTemplateFor(baseName: string, template: ElementViewTemplate | null): Configuration;
@@ -244,7 +244,7 @@ export class ConfigurationImpl implements Configuration {
244244
readonly prefix: string;
245245
// (undocumented)
246246
register(...registrations: ConfigurationRegistry[]): this;
247-
registerDesignToken<T>(registration: DesignTokenRegistration<T>): this;
247+
registerDesignToken<T>(registration: DesignTokenDefinition<T>): this;
248248
registerElement(type: typeof FASTElement, definition: PartialFASTElementDefinition): this;
249249
setDefaultStylesFor(name: string, styles: ElementStyles | null): this;
250250
setDefaultTemplateFor(name: string, template: ElementViewTemplate | null): this;
@@ -365,6 +365,22 @@ export interface CustomPropertyManagerClient extends FASTElement, HTMLElement {
365365
evaluate(definition: CSSCustomPropertyDefinition): string;
366366
}
367367

368+
// @public (undocumented)
369+
export class CustomPropertyManagerImpl {
370+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "alias"
371+
//
372+
// (undocumented)
373+
alias(key: string, name: string): void;
374+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "get"
375+
//
376+
// (undocumented)
377+
get(key: string, value: any): ElementStyles;
378+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "name"
379+
//
380+
// (undocumented)
381+
name(key: string): string;
382+
}
383+
368384
// @public
369385
export interface DecoratorDesignSystemPropertyConfiguration extends Omit<DecoratorAttributeConfiguration, "attribute"> {
370386
attribute?: string | false;
@@ -448,14 +464,65 @@ export const designSystemProvider: typeof defineDesignSystemProvider;
448464
// @public
449465
export const DesignSystemProviderTemplate: import("@microsoft/fast-element").ViewTemplate<DesignSystemProvider, any>;
450466

467+
// Warning: (ae-forgotten-export) The symbol "InheritableDesignTokenLibrary" needs to be exported by the entry point index.d.ts
468+
//
469+
// @public (undocumented)
470+
export class DesignTokenLibraryImpl<T> implements InheritableDesignTokenLibrary<T> {
471+
#constructor(init?: T);
472+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
473+
//
474+
// (undocumented)
475+
delete<K extends keyof T>(key: K): void;
476+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
477+
//
478+
// (undocumented)
479+
get<K extends keyof T>(key: K): T[K] | void;
480+
// Warning: (ae-forgotten-export) The symbol "DesignTokenLibrary" needs to be exported by the entry point index.d.ts
481+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "InheritableDesignTokenLibrary"
482+
//
483+
// (undocumented)
484+
handleChange<K extends keyof T>(source: DesignTokenLibrary<T>, keys: Array<K>): void;
485+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
486+
//
487+
// (undocumented)
488+
has<K extends keyof T>(key: K): boolean;
489+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "InheritableDesignTokenLibrary"
490+
//
491+
// (undocumented)
492+
hasLocal<K extends keyof T>(key: K): boolean;
493+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
494+
//
495+
// (undocumented)
496+
keys<K extends keyof T>(): K[];
497+
// (undocumented)
498+
private;
499+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
500+
//
501+
// (undocumented)
502+
set<K extends keyof T>(key: K, value: T[K]): void;
503+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
504+
//
505+
// (undocumented)
506+
subscribe(subscriber: Subscriber): void;
507+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
508+
//
509+
// (undocumented)
510+
unsubscribe(subscriber: Subscriber): void;
511+
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "InheritableDesignTokenLibrary"
512+
//
513+
// (undocumented)
514+
get upstream(): InheritableDesignTokenLibrary<T> | null;
515+
set upstream(target: InheritableDesignTokenLibrary<T> | null);
516+
}
517+
451518
// @public (undocumented)
452519
export const DesignTokenProvider: <TBase extends Constructable<FASTElement & HTMLElement>>(Base: TBase) => {
453520
new (...args: any[]): {
454-
designTokens: FASTDesignTokenLibrary<any>;
455-
customPropertyManager: FASTCustomPropertyManager;
521+
designTokens: DesignTokenLibraryImpl<any>;
522+
customPropertyManager: CustomPropertyManagerImpl;
456523
localSheets: Map<string, ElementStyles>;
457524
connectedCallback(): void;
458-
handleChange(source: FASTDesignTokenLibrary<any>, keys: Array<any>): void;
525+
handleChange(source: DesignTokenLibraryImpl<any>, keys: Array<any>): void;
459526
readonly $fastController: import("@microsoft/fast-element").Controller;
460527
$emit(type: string, detail?: any, options?: Pick<CustomEventInit<any>, "bubbles" | "cancelable" | "composed"> | undefined): boolean | void;
461528
disconnectedCallback(): void;
@@ -721,7 +788,7 @@ export const DesignTokenProvider: <TBase extends Constructable<FASTElement & HTM
721788
} & TBase;
722789

723790
// @public (undocumented)
724-
export const DesignTokens: InterfaceSymbol<FASTDesignTokenLibrary<any>>;
791+
export const DesignTokens: InterfaceSymbol<DesignTokenLibraryImpl<any>>;
725792

726793
// @public (undocumented)
727794
export const DI: Readonly<{
@@ -820,74 +887,6 @@ export class FactoryImpl<T extends Constructable = any> implements Factory<T> {
820887
Type: T;
821888
}
822889

823-
// @public (undocumented)
824-
export class FASTCustomPropertyManager {
825-
constructor(selector?: "host" | "root");
826-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "alias"
827-
//
828-
// (undocumented)
829-
alias(key: string, name: string): void;
830-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "get"
831-
//
832-
// (undocumented)
833-
get(key: string, value: any): ElementStyles;
834-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "name"
835-
//
836-
// (undocumented)
837-
name(key: string): string;
838-
}
839-
840-
// Warning: (ae-forgotten-export) The symbol "InheritableDesignTokenLibrary" needs to be exported by the entry point index.d.ts
841-
//
842-
// @public (undocumented)
843-
export class FASTDesignTokenLibrary<T> implements InheritableDesignTokenLibrary<T> {
844-
#constructor(init?: T);
845-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
846-
//
847-
// (undocumented)
848-
delete<K extends keyof T>(key: K): void;
849-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
850-
//
851-
// (undocumented)
852-
get<K extends keyof T>(key: K): T[K] | void;
853-
// Warning: (ae-forgotten-export) The symbol "DesignTokenLibrary" needs to be exported by the entry point index.d.ts
854-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "InheritableDesignTokenLibrary"
855-
//
856-
// (undocumented)
857-
handleChange<K extends keyof T>(source: DesignTokenLibrary<T>, keys: Array<K>): void;
858-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
859-
//
860-
// (undocumented)
861-
has<K extends keyof T>(key: K): boolean;
862-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "InheritableDesignTokenLibrary"
863-
//
864-
// (undocumented)
865-
hasLocal<K extends keyof T>(key: K): boolean;
866-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
867-
//
868-
// (undocumented)
869-
keys<K extends keyof T>(): K[];
870-
// (undocumented)
871-
private;
872-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
873-
//
874-
// (undocumented)
875-
set<K extends keyof T>(key: K, value: T[K]): void;
876-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
877-
//
878-
// (undocumented)
879-
subscribe(subscriber: Subscriber): void;
880-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "DesignTokenLibrary"
881-
//
882-
// (undocumented)
883-
unsubscribe(subscriber: Subscriber): void;
884-
// Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/fast-foundation" does not have an export "InheritableDesignTokenLibrary"
885-
//
886-
// (undocumented)
887-
get upstream(): InheritableDesignTokenLibrary<T> | null;
888-
set upstream(target: InheritableDesignTokenLibrary<T> | null);
889-
}
890-
891890
// @public
892891
export class Flipper extends FASTElement {
893892
direction: FlipperDirection;

packages/web-components/fast-foundation/src/configuration/configuration.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
CSSCustomPropertyManager,
99
CustomPropertyManagerImpl,
1010
} from "../css-custom-property-manager";
11-
import { DesignTokens, DesignTokenLibraryImpl } from "../design-tokens";
12-
import { DesignTokenRegistration } from "../design-tokens/configuration";
11+
import { DesignTokenLibraryImpl, DesignTokens } from "../design-tokens";
12+
import { DesignTokenDefinition } from "../design-tokens/configuration";
1313
import { DI, InterfaceSymbol, Key, Registration } from "../di";
1414
import { supportsAdoptedStylesheets } from "../feature-detection";
1515

@@ -95,7 +95,7 @@ export interface Configuration {
9595
* Register a design token for the applicaiton.
9696
* @param registration The token registration
9797
*/
98-
registerDesignToken<T>(registration: DesignTokenRegistration<T>): Configuration;
98+
registerDesignToken<T>(registration: DesignTokenDefinition<T>): Configuration;
9999

100100
/**
101101
*
@@ -231,7 +231,7 @@ export class ConfigurationImpl implements Configuration {
231231
}
232232

233233
/** {@inheritdoc Configuration.registerDesignToken} */
234-
public registerDesignToken<T>(registration: DesignTokenRegistration<T>) {
234+
public registerDesignToken<T>(registration: DesignTokenDefinition<T>) {
235235
const { key, value, customProperty } = registration;
236236
this.designTokenRegistry.set(key, registration);
237237

@@ -277,7 +277,7 @@ export class ConfigurationImpl implements Configuration {
277277
private templateRegistry = new Map<string, ElementViewTemplate | null>();
278278
private stylesRegistry = new Map<string, ElementStyles | null>();
279279
private elementRegistry = new Map<typeof FASTElement, PartialFASTElementDefinition>();
280-
private designTokenRegistry = new Map<string, DesignTokenRegistration<any>>();
280+
private designTokenRegistry = new Map<string, DesignTokenDefinition<any>>();
281281
}
282282

283283
export const ConfigurationInterface: InterfaceSymbol<Key, any> = DI.createInterface(

packages/web-components/fast-foundation/src/design-tokens/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface DesignTokenRegistration<T> {
1+
export interface DesignTokenDefinition<T> {
22
/**
33
* The key for which the token can be accessed.
44
*/

packages/web-components/fast-foundation/src/design-tokens/library.spec.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assert, expect } from "chai";
2-
import { FASTDesignTokenLibrary } from "./library";
2+
import { DesignTokenLibraryImpl } from "./library";
33

44
interface DS {
55
color: string;
@@ -9,12 +9,12 @@ interface DS {
99
describe("FASTDesignTokens", () => {
1010
describe("should initialize", () => {
1111
it("without any properties are no object is provided to the constructor", () => {
12-
const ds = new FASTDesignTokenLibrary();
12+
const ds = new DesignTokenLibraryImpl();
1313

1414
assert(ds.keys().length === 0);
1515
});
1616
it("with any provided properties set to the provided value", () => {
17-
const ds = new FASTDesignTokenLibrary<DS>({
17+
const ds = new DesignTokenLibraryImpl<DS>({
1818
color: "red",
1919
size: 2,
2020
});
@@ -26,49 +26,49 @@ describe("FASTDesignTokens", () => {
2626
});
2727
describe("should get a property value", () => {
2828
it("that has been set on the implementation", () => {
29-
const ds = new FASTDesignTokenLibrary<DS>();
29+
const ds = new DesignTokenLibraryImpl<DS>();
3030
ds.set("color", "red");
3131

3232
assert(ds.get("color") === "red");
3333
});
3434

3535
it("that is undefined if the value has not been set", () => {
36-
const ds = new FASTDesignTokenLibrary<DS>();
36+
const ds = new DesignTokenLibraryImpl<DS>();
3737

3838
assert(ds.get("color") === undefined);
3939
});
4040

4141
it("that has been set on the upstream when no local implementation is set", () => {
42-
const upstream = new FASTDesignTokenLibrary<DS>();
42+
const upstream = new DesignTokenLibraryImpl<DS>();
4343
upstream.set("color", "red");
44-
const downstream = new FASTDesignTokenLibrary<DS>();
44+
const downstream = new DesignTokenLibraryImpl<DS>();
4545
downstream.upstream = upstream;
4646

4747
assert(downstream.get("color") === "red");
4848
});
4949

5050
it("from the downstream if it has been set on both the upstream and the downstream", () => {
51-
const upstream = new FASTDesignTokenLibrary<DS>();
51+
const upstream = new DesignTokenLibraryImpl<DS>();
5252
upstream.set("color", "red");
53-
const downstream = new FASTDesignTokenLibrary<DS>();
53+
const downstream = new DesignTokenLibraryImpl<DS>();
5454
downstream.upstream = upstream;
5555
downstream.set("color", "blue");
5656

5757
assert(downstream.get("color") === "blue");
5858
});
5959

6060
it("from itself when defined both on itself and the downstream", () => {
61-
const upstream = new FASTDesignTokenLibrary<DS>();
61+
const upstream = new DesignTokenLibraryImpl<DS>();
6262
upstream.set("color", "red");
63-
const downstream = new FASTDesignTokenLibrary<DS>();
63+
const downstream = new DesignTokenLibraryImpl<DS>();
6464
downstream.upstream = upstream;
6565
downstream.set("color", "blue");
6666

6767
assert(upstream.get("color") === "red");
6868
});
6969

7070
it("that is undefined if the property is set and then deleted", () => {
71-
const ds = new FASTDesignTokenLibrary<DS>();
71+
const ds = new DesignTokenLibraryImpl<DS>();
7272
ds.set("color", "red");
7373
ds.delete("color");
7474

@@ -77,8 +77,8 @@ describe("FASTDesignTokens", () => {
7777
});
7878

7979
it("should not get notified when attaching to an upstream when no properties on the upstream are set", () => {
80-
const upstream = new FASTDesignTokenLibrary<DS>();
81-
const downstream = new FASTDesignTokenLibrary<DS>();
80+
const upstream = new DesignTokenLibraryImpl<DS>();
81+
const downstream = new DesignTokenLibraryImpl<DS>();
8282
let called = false;
8383

8484
downstream.handleChange = (source, keys) => {
@@ -91,8 +91,8 @@ describe("FASTDesignTokens", () => {
9191
});
9292

9393
it("should get notified with all set properties of the upstream implementation when attaching", () => {
94-
const upstream = new FASTDesignTokenLibrary<DS>();
95-
const downstream = new FASTDesignTokenLibrary<DS>();
94+
const upstream = new DesignTokenLibraryImpl<DS>();
95+
const downstream = new DesignTokenLibraryImpl<DS>();
9696
let called = false,
9797
source = {},
9898
args = [] as any;
@@ -114,8 +114,8 @@ describe("FASTDesignTokens", () => {
114114
});
115115

116116
it("should get notified of an upstream property change", () => {
117-
const upstream = new FASTDesignTokenLibrary<DS>();
118-
const downstream = new FASTDesignTokenLibrary<DS>();
117+
const upstream = new DesignTokenLibraryImpl<DS>();
118+
const downstream = new DesignTokenLibraryImpl<DS>();
119119
let called = false,
120120
source = {},
121121
args = [] as any;
@@ -138,8 +138,8 @@ describe("FASTDesignTokens", () => {
138138
});
139139

140140
it("should notify the downstream of property changes after detachment", () => {
141-
const upstream = new FASTDesignTokenLibrary<DS>();
142-
const downstream = new FASTDesignTokenLibrary<DS>();
141+
const upstream = new DesignTokenLibraryImpl<DS>();
142+
const downstream = new DesignTokenLibraryImpl<DS>();
143143
let called = false,
144144
source = {},
145145
args = [] as any;
@@ -164,8 +164,8 @@ describe("FASTDesignTokens", () => {
164164

165165
describe("should not notify", () => {
166166
it("if a delete doesn't result in a change", () => {
167-
const upstream = new FASTDesignTokenLibrary<DS>();
168-
const downstream = new FASTDesignTokenLibrary<DS>();
167+
const upstream = new DesignTokenLibraryImpl<DS>();
168+
const downstream = new DesignTokenLibraryImpl<DS>();
169169
upstream.set("color", "red");
170170
downstream.set("color", "red");
171171
let calls = 0;
@@ -187,8 +187,8 @@ describe("FASTDesignTokens", () => {
187187
});
188188

189189
it("if setting a property doesn't result in a change", () => {
190-
const upstream = new FASTDesignTokenLibrary<DS>();
191-
const downstream = new FASTDesignTokenLibrary<DS>();
190+
const upstream = new DesignTokenLibraryImpl<DS>();
191+
const downstream = new DesignTokenLibraryImpl<DS>();
192192
let calls = 0;
193193
const subscriber = {
194194
handleChange: (source, keys) => {

0 commit comments

Comments
 (0)