No announcement yet.
  • Filter
  • Time
Clear All
new posts

  • #91
    Just access the ID property on the DataSource returned by getDataSource().


    • #92
      Regarding your list of possible non-classes:

      VisualBuilder and SelectionOutline are indeed classes. Not sure why they're on this list.
      "TooLStripSeparatorEditProxy" appeared in the doc wrongly due to a typo we'll fix.

      "EBay" shouldn't be there at all, we'll get rid of it.

      WSRequest, FacetValue and ServerObject should all actually be @object, we'll fix that.

      These are libraries of static methods which cannot be true classes because they need to exist before the Class system itself loads, so cannot be true classes:

      These are extensions of native JavaScript objects:

      For both categories, we could alter these to be @object, and add a new type of definition like @staticMethod, the equivalent of @classMethod but for objects. Would that work?


      • #93
        VisualBuilder and SelectionOutline and all the others are on the list because in the Docs there is no 'extends Class' in the description as there is with most other classes that inherit directly from Class.
        2017-05-20 07_29_29-does not extend class.png

        I have just noticed also that the description says 'for internal use only' so perhaps there shouldn't be any TypeScript representation at all. If so, could we put an attribute on those classes that are for internal use only so the generator will know to not generate anything for them?

        For libraries of static methods: Yes, marked as object with staticMethods seems more appropriate and would help the generator do the right thing (i.e. it will know not to add 'extends Class').

        For the extensions of native JavaScript objects: Could we mark them as something different? The reason being that they need to be handled differently than classes and objects. Classes and objects become interfaces with the same name in TypeScript (and also the _Static and _Props versions). For the extensions, so far I've only dealt with Array (manually) and it seems to be working (altough it is not complete) so I'm assuming Date and String will be similar. This code is near the top of the isc.index.d.ts file:

         * Generic extensions to JavaScript Arrays. You can call these on any Array.
         * JavaScript's native Array is retrofitted to support the List API (not implemented yet).
        interface ArrayConstructor {
            isLoading(value: any): boolean;
            compareAscending(first: any, second: any): number;
            compareDescending(first: any, second: any): number;
        } // Array
        If there were some way to identify these, then the generator could automatically do the right thing (i.e outside of the Isc namespace and appends Constructor to the name) without maintaining a list of special cases.